Re: COPY and sequences - Mailing list pgsql-bugs

From Neil Conway
Subject Re: COPY and sequences
Date
Msg-id 87u15cxbe8.fsf@mailbox.samurai.com
Whole thread Raw
In response to COPY and sequences  ("Przemysław" <przemyslaw.slupkowski@euro.coig.pl>)
List pgsql-bugs
"Przemys=B3aw" <przemyslaw.slupkowski@euro.coig.pl> writes:
> Hello
> I dont know is this a bug but when I use COPY to load data into table
> sequence of the primary key in this table have always start value =3D
> 1.

Doesn't sound like a bug. If the input data for COPY does not include
PK values, you should not include the PK column in the COPY's column
list, and make sure the PK column's default value gets the nextval()
from the sequence.

-Neil

pgsql-bugs by date:

Previous
From: Neil Conway
Date:
Subject: Re: before trigger doesn't, on insert of too long data
Next
From: Neil Conway
Date:
Subject: Re: pg_dumpall does not save CREATE permission on databases