We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Is there any way to show some columns are defined as AUTO_INCREMENT in vsql command prompt? — Vertica Forum
Options

Is there any way to show some columns are defined as AUTO_INCREMENT in vsql command prompt?

In vsql prompt, \d command shows type of AUTO_INCREMENT columns as "int".
Is there any way to show some columns are defined as AUTO_INCREMENT?

Best Answer

  • Answer ✓

    I have noticed \ds helps, but is there any better ways?

Answers

  • moshegmosheg Vertica Employee Administrator

    Consider one of the options below:

    1. SELECT EXPORT_OBJECTS('','your_schema_name.your_table_name','true');

    2. For tables using default sequences like "DEFAULT my_seq.NEXTVAL"
      do:
      SELECT table_schema,table_name,column_name,data_type,column_default
      from columns
      where table_schema = 'your_schema_name' and table_name = 'your_table_name';

    3. For tables using IDENTITY sequences do:
      SELECT table_schema,table_name,column_name,data_type,column_default
      from columns
      where is_identity;

This discussion has been closed.