I'm inserting bulk records using COPY
statement in PostgreSQL. What I realize is, the sequence IDs are not getting updated and when I try to insert a record later, it throws duplicate sequence ID. Should I manually update the sequence number to get the number of records after performing COPY
? Isn't there a solution while performing COPY
, just increment the sequence variable, that is, the primary key field of the table? Please clarify me on this. Thanks in advance!
For instance, if I insert 200 records, COPY
does good and my table shows all the records. When I manually insert a record later, it says duplicate sequence ID error
. It very well implies that it didn’t increment the sequence ids during COPYing as work fine during normal INSERTing. Instead of instructing the sequence id to set the max number of records, won’t there be any mechanism to educate the COPY
command to increment the sequence IDs during its bulk COPYing option?