Last active
March 17, 2022 07:39
-
-
Save neos1803/a213b0be55d1ddae9ffdee4fca9b0626 to your computer and use it in GitHub Desktop.
List all tables referenced by a specific column name (by FK) PostgreSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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