Skip to main content

Search all database table columns

Published: 2019-08-16 • Last updated: 2019-09-12

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%';