Re: Bug? - Mailing list pgsql-general

From Tom Lane
Subject Re: Bug?
Date
Msg-id 12664.1005841042@sss.pgh.pa.us
Whole thread Raw
In response to Bug?  (Rasmus Resen Amossen <NOSPAM@hey.com>)
List pgsql-general
Rasmus Resen Amossen <NOSPAM@hey.com> writes:
> I got a table with a "serial" attribute. For example
> CREATE TABLE test (
>   id SERIAL NOT NULL,
>   val INT
> );

> The the following insertions creates an error:
> INSERT INTO test(id,val) VALUES (1,1);
> INSERT INTO test(val) VALUES (1);

> Error:
> Cannot insert a duplicate key into unique index test_id_key

If you're going to assign IDs manually, you might want to set
the sequence generator past those values.  See setval().

            regards, tom lane

pgsql-general by date:

Previous
From: Vivek Khera
Date:
Subject: Re: Modifying check constraints
Next
From: "Jacob Vennervald Madsen"
Date:
Subject: Re: Postgres+Delphi