title: Why are sequences not updated when COPY is performed in PostgreSQL?
body: <p>I'm inserting bulk records using <code>COPY</code> 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 <code>COPY</code>? Isn't there a solution while performing <code>COPY</code>, just increment the sequence variable, that is, the primary key field of the table? Please clarify me on this. Thanks in advance!</p>
  
  <p>For instance, if I insert 200 records, <code>COPY</code> does good and my table shows all the records. When I manually insert a record later, it says <code>duplicate sequence ID error</code>. 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 <code>COPY</code> command to increment the sequence IDs during its bulk COPYing option?</p>