The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.
Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

Alter table to create IDENTITY



I am relatively new to Vertica so pardon if my question seems basic...


I loaded a Vertica table and I am trying to ALTER a column to IDENTITY.


I know you simply cannot turn the IDENTITY on/off in Vertica like SQL server, but my idea is to load the table first and then set the identity. Is this possible? Is this best practice? 


Thank you all in advance.



      Try using sequences instead of auto_increment, the reason is that you can change the default value of the column(simulate auto increment OFF) and change it back after you have inserted your data(simulate auto increment ON).


     Every time you switch on of off just alter the sequence definition to your max value of the column you have the id on.


    make sure you give it the int value, subquery won`t work


Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file