Skip to content

Instantly share code, notes, and snippets.

@devCcori
Created August 17, 2022 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devCcori/7ee313ce2cc739019e7879880d583e16 to your computer and use it in GitHub Desktop.
Save devCcori/7ee313ce2cc739019e7879880d583e16 to your computer and use it in GitHub Desktop.
select t.table_schema,
t.table_name
from information_schema.tables t
inner join information_schema.columns c on c.table_name = t.table_name
and c.table_schema = t.table_schema
where c.column_name = 'COLUMN_TO_FIND'
and t.table_schema not in ('information_schema', 'pg_catalog')
and t.table_type = 'BASE TABLE'
order by t.table_schema;
@devCcori
Copy link
Author

Scritp to find a column in a Postgres Database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment