How can I copy an IDENTITY field?

You can't INSERT data setting the IDENTITY columns, but you can load data from S3 using COPY command.

First you will need to create a dump of source table with UNLOAD.

Then simply use COPY with EXPLICIT_IDS parameter as described in Loading default column values:

If an IDENTITY column is included in the column list, the EXPLICIT_IDS option must also be specified in the COPY command, or the COPY command will fail. Similarly, if an IDENTITY column is omitted from the column list, and the EXPLICIT_IDS option is specified, the COPY operation will fail.


You can explicitly specify the columns, and ignore the identity column: insert into existing_table (col1, col2) select col1, col2 from another_table;