Re: COPY and sequences

From: Neil Conway <neilc(at)samurai(dot)com>
To: Przemysław <przemyslaw(dot)slupkowski(at)euro(dot)coig(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: COPY and sequences
Date: 2003-11-10 19:37:51
Message-ID: 87u15cxbe8.fsf@mailbox.samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Przemysław" <przemyslaw(dot)slupkowski(at)euro(dot)coig(dot)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 =
> 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Neil Conway 2003-11-10 19:49:11 Re: pg_dumpall does not save CREATE permission on databases
Previous Message Neil Conway 2003-11-10 19:35:09 Re: before trigger doesn't, on insert of too long data