Adding a auto incremental column into existing redshift table -


i have table in redshift.

i want add column should have incremental values. dont want drop table , create new one.

please suggest command add column having auto incremental values in redshift table.

thanks !!!

it not possible add identity column existing table.

it might easiest create new table new identity column, , copy data it. note values aren't guaranteed increase monotonically - i.e. there may gaps.

from http://docs.aws.amazon.com/redshift/latest/dg/r_alter_table.html :

you cannot use alter table add column command modify following table , column attributes:

unique

primary key

references (foreign key)

identity


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -