Find tables that are not referenced by the foreign keys in Vertica database

Query below lists all not referenced tables by any foreign key.

See also:


select '>- no FKs' as foreign_keys,
from v_catalog.tables tab
left join v_catalog.foreign_keys fks
          on tab.table_schema = fks.reference_table_schema
          and tab.table_name = fks.reference_table_name
where fks.constraint_id is null
order by tab.table_schema,


  • foreign_keys - symbol indicating lack of FK references
  • table_schema - name of the schema
  • table_name - table name


  • One row represents one table
  • Scope of rows: tables in a database which are not referenced by any foreign key
  • Ordered by table schema, table name

Sample results

Tables in VMart not referenced by foreign keys:

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
There are no comments. Click here to write the first comment.