I like to update some parameters for the table, such as the dist and sort key. To do this, Ive renamed the old version of the table and recreated the table with new parameters (they cannot be changed after creating the table).
I need to save the id field from an old table, which is an IDENTITY field. However, if I try to execute the following query, I get an error message:
insert into edw.my_table_new select * from edw.my_table_old; ERROR: cannot set an identity column to a value [SQL State=0A000]
How can I keep the same id from the old table?
source share