Hey
I am trying to do an insert into ... select * from ...
I am basically migrating some old data into a table with an identical schema. If I try and do this as a straight insert into select * ... the pkey field unique constraint stops this from working..
I know I can do it by using something like
insert into t1 col2, col3, col4... values select col2, col3, col4, ...
but just for interest's sake i was wondering if pgsql allowed you to force new pkey values to be generated for the inserted values so you don't have to type out all the column names minus the pkey column name.
I'm using 7.4 btw.
Thanks!
quilmes
I am trying to do an insert into ... select * from ...
I am basically migrating some old data into a table with an identical schema. If I try and do this as a straight insert into select * ... the pkey field unique constraint stops this from working..
I know I can do it by using something like
insert into t1 col2, col3, col4... values select col2, col3, col4, ...
but just for interest's sake i was wondering if pgsql allowed you to force new pkey values to be generated for the inserted values so you don't have to type out all the column names minus the pkey column name.
I'm using 7.4 btw.
Thanks!
quilmes