List table default values in Vertica database

This query returns list of all columns with a default value in a specific table.

Query

select table_schema,
       table_name,
       column_name,
       column_default
from v_catalog.columns
where length(column_default) > 0
order by table_schema,
         table_name,
         ordinal_position;

Columns

  • table_schema - schema name
  • table_name - table name
  • column_name - column name
  • column_default - column's default value

Rows

  • One row represents one column
  • Scope of rows: columns with a default value in a specified table
  • Ordered by column name

Sample results

0
There are no comments. Click here to write the first comment.