Re: Bug?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Rasmus Resen Amossen <NOSPAM(at)hey(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Bug?
Date: 2001-11-15 15:54:51
Message-ID: 20011115075338.Y7419-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 15 Nov 2001, Rasmus Resen Amossen wrote:

> I am using postgresql-7.0.3 and is now having a strange problem!!!
> 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
>
> After that I can just reeat the second line and insert without errors.
> Is this bug fixed in newer versions?

You shouldn't insert values into the serial column :). Or at least if you
are going to do manual inserts you need to update the sequence as well.

In response to

  • Bug? at 2001-11-15 02:02:41 from Rasmus Resen Amossen

Browse pgsql-general by date

  From Date Subject
Next Message Vivek Khera 2001-11-15 16:04:09 Re: Modifying check constraints
Previous Message Stephan Szabo 2001-11-15 15:53:20 Re: Modifying check constraints