From: Scott Cain <cain@cshl.org>
To: Dmitry Tkach <dmitry@openratings.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Cannot insert dup id in pk
Date: 15 Jul 2003 12:47:32 -0400
Message-ID: <1058287652.1444.8.camel@localhost.localdomain> (raw)
In-Reply-To: <3F1412F6.2020100@openratings.com>
References: <1058274025.1451.6.camel@localhost.localdomain>
<3F1412F6.2020100@openratings.com>
On Tue, 2003-07-15 at 10:43, Dmitry Tkach wrote:
> You must have your sequence out of date with the content of the table
> (so that the next value in the sequence has already been inserted).
> One way to get into a situation like that is loading the table data with
> COPY (the input contains the pks, and the COPY command does not update
> the sequence, you have to do that manually after the copy is done).
Yes, this is exactly what happened. I had no idea that copy didn't
update the sequence. I suspect I've got users who are being bitten by
this and don't realize it. I'll have to change my "bulk loading" script
to update the sequence after the load is done.
Thanks much,
Scott
--
------------------------------------------------------------------------
Scott Cain, Ph. D. cain@cshl.org
GMOD Coordinator (http://www.gmod.org/) 216-392-3087
Cold Spring Harbor Laboratory
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: cain@cshl.org, dmitry@openratings.com
Subject: Re: Cannot insert dup id in pk
In-Reply-To: <1058287652.1444.8.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox