You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--postgres introspection emits no FK 'references' edges (only contains/reads_from) #1746
Live PostgreSQL introspection (--postgres) produces no foreign-key references edges — only contains and reads_from. The README/docs state tables, views, functions + FK relationships are mapped.
Environment
graphifyy 0.9.7 (pipx, with [sql] extra + injected psycopg[binary]), Python 3.14.5, macOS (arm64)
PostgreSQL 15 (Supabase-hosted), connected via PG* env vars (--postgres "")
Edge relation counts in graph.json: {'contains': 459, 'reads_from': 183} — zero references
Concrete example: a table with ~15 inbound FKs shows only db --contains--> plus 3 function --reads_from--> edges.
For comparison, file-based extraction of the same schema's migration .sql files does produce references edges between tables — so the gap appears specific to the live-introspection path (pg_introspect.py).
The function→table reads_from edges are genuinely useful, by the way — happy to share redacted edge stats if helpful.
Fixed on v8 (0.9.12), credited to @rithyKabir via #1761. The FK query now reads pg_catalog.pg_constraint instead of the privilege-filtered information_schema.referential_constraints, so a read-only --postgres role gets references edges (previously zero while tables/views appeared). Bonus: oid-based keying fixes same-named constraints on sibling tables cross-matching. Thanks for pinning it to the live-introspection path.
Perfect — thank you for the quick turnaround, and thanks to @rithyKabir for the fix via #1761.
Reading `pg_catalog.pg_constraint` directly instead of the privilege-filtered `information_schema.referential_constraints` is exactly right: we hit this on a read-only Supabase introspection role, and the `information_schema` views silently drop rows the role doesn't own — which is why we saw zero `references` edges while tables/views/functions all came through fine. The oid-based keying fix for same-named constraints on sibling tables is a welcome bonus too; we have plenty of those.
We'll upgrade to 0.9.12 and move our live schema graph over to the `--postgres` path. Appreciate the work! 🙏
Activity
fix(pg_introspect): read FKs from pg_constraint so read-only roles ge…
safishamsi commentedon Jul 10, 2026
Fixed on v8 (0.9.12), credited to @rithyKabir via #1761. The FK query now reads
pg_catalog.pg_constraintinstead of the privilege-filteredinformation_schema.referential_constraints, so a read-only--postgresrole getsreferencesedges (previously zero while tables/views appeared). Bonus: oid-based keying fixes same-named constraints on sibling tables cross-matching. Thanks for pinning it to the live-introspection path.bbqboogiedwonsen commentedon Jul 11, 2026
Perfect — thank you for the quick turnaround, and thanks to @rithyKabir for the fix via #1761.
Reading `pg_catalog.pg_constraint` directly instead of the privilege-filtered `information_schema.referential_constraints` is exactly right: we hit this on a read-only Supabase introspection role, and the `information_schema` views silently drop rows the role doesn't own — which is why we saw zero `references` edges while tables/views/functions all came through fine. The oid-based keying fix for same-named constraints on sibling tables is a welcome bonus too; we have plenty of those.
We'll upgrade to 0.9.12 and move our live schema graph over to the `--postgres` path. Appreciate the work! 🙏
fix(pg_introspect): read FKs from pg_constraint so read-only roles ge…
Fix: recover SQL CREATE POLICY statements as nodes (Graphify-Labs#3401)