Find Which Tables Have a Particular Column Name: Quick Tip

Your Vertica database probably contains hundreds, if not thousands, of tables. Trying to remember which tables contain a certain column can be a daunting task….

OpenText  profile picture
OpenText

October 09, 20181 min read

Shot of a young computer programmer working on source code

Your Vertica database probably contains hundreds, if not thousands, of tables. Trying to remember which tables contain a certain column can be a daunting task. Instead, query the V_CATALOG.COLUMNS system table!

Example:

Which tables have a column named “DateKey”?

dbadmin=> SELECT table_schema, table_name, column_name
dbadmin-> FROM v_catalog.columns
dbadmin-> WHERE column_name = 'DateKey'
dbadmin-> ORDER BY 1, 2, 3;
table_schema | table_name | column_name
--------------+-------------------------+-------------
warehouse | BridgeCustomerAccount | DateKey
warehouse | BridgeHouseholdCustomer | DateKey
warehouse | DimDate | DateKey
warehouse | FactAccount | DateKey
warehouse | FactAccountScore | DateKey
warehouse | FactCustomer | DateKey
warehouse | FactCustomerScore | DateKey
warehouse | FactHousehold | DateKey
warehouse | FactHouseholdScore | DateKey
(9 rows)

Which tables have a column with a name that contains the text “ssn”?

dbadmin=> SELECT table_schema, table_name, column_name
dbadmin-> FROM v_catalog.columns
dbadmin-> WHERE column_name ILIKE '%ssn%';
table_schema | table_name | column_name
--------------+---------------+-------------
public | employee_fact | ssn
dw | emp_dim | SSN
(2 rows)

Have fun!

Share this post

Share this post to x. Share to linkedin. Mail to
OpenText avatar image

OpenText

OpenText, The Information Company, enables organizations to gain insight through market-leading information management solutions, powered by OpenText Cloud Editions.

See all posts

More from the author

Limitless: What it means for innovation

Limitless: What it means for innovation

AI paves the way to the future

July 04, 2025

3 min read

Limitless: What it means for peace of mind

Limitless: What it means for peace of mind

Rest easy with AI-driven security

July 04, 2025

3 min read

Limitless: What it means for productivity

Limitless: What it means for productivity

AI elevates human potential

July 04, 2025

3 min read

Stay in the loop!

Get our most popular content delivered monthly to your inbox.