Skip to content

Instantly share code, notes, and snippets.

@neos1803
Last active March 17, 2022 07:39
Show Gist options
  • Save neos1803/a213b0be55d1ddae9ffdee4fca9b0626 to your computer and use it in GitHub Desktop.
Save neos1803/a213b0be55d1ddae9ffdee4fca9b0626 to your computer and use it in GitHub Desktop.
List all tables referenced by a specific column name (by FK) PostgreSQL
select table_schema, table_name
from information_schema.columns
where table_schema not in
('information_schema','pg_catalog')
and column_name = 'id_masa' -- insert referencing column name, eq: id_masa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment