The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

Find Which System Tables Have a Particular Column Name

There are over 180 built-in Vertica system tables in the V_CATALOG and V_MONITOR schemas. Trying to remember which system tables contain a certain column can be a daunting task. Instead, query the V_CATALOG.SYSTEM_COLUMNS system table!

Example:

dbadmin=> SELECT table_schema, table_name, column_name
dbadmin->   FROM v_catalog.system_columns
dbadmin->  WHERE column_name = 'anchor_table_name'
dbadmin->  ORDER BY 1, 2, 3;
table_schema |         table_name          |    column_name
--------------+-----------------------------+-------------------
v_catalog    | projections                 | anchor_table_name
v_monitor    | column_storage              | anchor_table_name
v_monitor    | deployment_projections      | anchor_table_name
v_monitor    | projection_refreshes        | anchor_table_name
v_monitor    | projection_storage          | anchor_table_name
v_monitor    | projection_usage            | anchor_table_name
v_monitor    | rebalance_projection_status | anchor_table_name
(7 rows)

Helpful links:
https://www.vertica.com/docs/9.1.x/HTML/index.htm#Authoring/SQLReferenceManual/SystemTables/CATALOG/SYSTEM_COLUMNS.htm

Have fun!

Sign In or Register to comment.

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.