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
Scott Cain <[EMAIL PROTECTED]> writes:
> Note that I do not try to insert anything into fid, the primary key on
> this table. Why does Postgres think I am?
But you *are* trying to insert something into fid, namely the default
value:
default nextval('public.fdata _fid_seq'::text)
My guess
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,
Title: RE: [SQL] Cannot insert dup id in pk
I suspect the sequence is out of sync with the values actually in you primary key (which I gues is fid.
Try this query
SELECT setval('public.fdata _fid_seq'::text,MAX(fid)+1) FROM fdata;
This should set the value of the sequence to t