I'm trying to copy a Postgres table1 to another table2 while changing the value of one of the columns. To make the transfer faster I run 10 different processes each having different offsets in the table1 to start from, e.g., 1st process
: SELECT * FROM table OFFSET offset1 LIMIT x;
then copy to table2
, 2nd process
: SELECT * FROM table OFFSET offset2 LIMIT x
then copy to table2
.
But even though I don't have duplicate rows in my table1
I do get duplicate rows in my table2
(x
is smaller than offset2-offset1
). Is it possible that the same offset
value is not pointing to the same row in the table across different processes? If yes, what would be better way to copy a table while modifying a column in Postgres? Thanks!