Relationship column lists are null for dotted/mixed-case schemas
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- postgresql, typescript
- Domain
- databases
Research direction
Start at the definitions of TABLE_RELATIONSHIPS_SQL and VIEWS_KEY_DEPENDENCIES_SQL, then trace the relationships.list entry point used by PostgresMetaRelationships. Reproduce the issue with the provided dotted-schema SQL and includedSchemas value. Done means relationship results populate columns and referenced_columns for dotted and mixed-case schemas.
Written by the indexing model from the issue text.
Description
Bug
TABLE_RELATIONSHIPS_SQL / VIEWS_KEY_DEPENDENCIES_SQL filter some clauses with connamespace::regnamespace::text, while the outer table filter correctly uses nspname.
For schemas that need quoting, those differ:
| nspname | ::regnamespace::text |
|---|---|
odd.schema |
"odd.schema" |
MySchema |
"MySchema" |
So IN ('odd.schema') matches nspname but misses regnamespace::text. The FK lateral still returns a row (aggregate), but with null columns / referenced_columns.
Impact
Typegen relationship inference (PostgresMetaRelationships) drops FK column info for projects that use dotted or mixed-case schema names.
Repro
create schema "odd.schema";
create table "odd.schema".parent (id int8 primary key);
create table "odd.schema".child (
id int8 primary key,
parent_id int8 references "odd.schema".parent (id)
);
Then relationships.list({ includedSchemas: ['odd.schema'] }) — relationship exists but columns / referenced_columns are null.
Expected
Filter by nspname (or oid via pg_namespace) consistently so column lists are populated.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 223
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/postgres-meta
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
supabase/postgres-meta#1150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
supabase/postgres-meta#1146 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
supabase/postgres-meta#1143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
supabase/postgres-meta#1142 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
supabase/postgres-meta#1140 ·
All issues in supabase/postgres-meta
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·