BUG #1202: Primary Key constraint not respected - Mailing list pgsql-bugs

From PostgreSQL Bugs List
Subject BUG #1202: Primary Key constraint not respected
Date
Msg-id 20040728100353.57D6CCF4D03@www.postgresql.com
Whole thread Raw
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1202
Logged by:          Enrico

Email address:      carrara@pd.infn.it

PostgreSQL version: 7.4

Operating system:   linux Debian Sarge

Description:        Primary Key constraint not respected

Details:

Hi, I'm using version 7.4.2.
I created this table (italian text, sorry):

prova=> \d crate
          Tabella "public.crate"
 Colonna  |  Tipo   |    Modificatori
----------+---------+---------------------
 code     | integer | not null
 location | integer | default 1
 capacity | integer | not null default 70
Indici:
    "code" chiave primaria, btree (code)

("code" is primay key, without oids)

I entered twice the same "code" and I got no error, as you can see:

prova=> select * from crate where code > 500;
 code | location | capacity
------+----------+----------
  503 |        1 |       48
  503 |        1 |       48
  501 |        1 |        1
  502 |        1 |        1
  504 |        1 |       48
(5 righe)

It happened only once, now it correctly says:

prova=> insert into crate (code) values (503);
ERROR:  duplicate key violates unique constraint "code"

Thanks.
-E-nrico

pgsql-bugs by date:

Previous
From: Joe Conway
Date:
Subject: Re: casting strings to multidimensional arrays yields strange
Next
From: Tom Lane
Date:
Subject: Re: casting strings to multidimensional arrays yields strange results