Find a table by the name in Vertica database

Query below finds tables with specific name in all schemas in a database.

Query

select table_schema,
       table_name
from v_catalog.tables
where table_name = 'table_name' -- put table name here
      -- and table_schema = 'schema name' -- put schema name here
order by table_schema;

Columns

  • table_schema - name of schema table was found in
  • table_name - name of table (redundant as it should be exactly the same as provided)

Rows

  • One row represents a table
  • Scope of rows: all found tables
  • Ordered by schema name

Notes

  1. There migh be more tables than one because different schemas in a database can have tables with the same names

Sample results