Skip to main content

Search All Database Table Columns

Published: 2019-08-16 • Last updated: 2021-05-03

Ever wanted to search an entire database for a column by name? Well, put your detective hat on, ‘cause it’s possible.

# Oracle

SELECT * 
FROM all_tab_cols
WHERE column_name LIKE '%<FOO>%';

# Postgres

SELECT * 
FROM information_schema.columns
WHERE column_name LIKE '%<foo>%';