Re: BUG #8610: Duplicate records with same PK value

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: nhajek(at)meridian-technical(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8610: Duplicate records with same PK value
Date: 2013-11-23 08:02:00
Message-ID: CAB7nPqSXcekwrh8WeXnc+ZythohjK+i0bEotsSCiPT=K7dEmOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Nov 20, 2013 at 12:07 PM, <nhajek(at)meridian-technical(dot)com> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 8610
> Logged by: Nick Hajek
> Email address: nhajek(at)meridian-technical(dot)com
> PostgreSQL version: 9.3.1
> Operating system: Windows 7 x64
> Description:
>
> Updating a record with a primary key resulted in 2 records in the table with
> the same primary key. I'm able to view both using a number of pg manager
> application and a select for the single pk value of interest returns 2
> records.
Could you provide a self-contained test case? A check on the primary
key constraint is done when changing such tuples like in the following
case:
=# create table aa (a int primary key);
CREATE TABLE
=# insert into aa values (1),(2);
INSERT 0 2
=# update aa set a = 1 where a = 2;
ERROR: 23505: duplicate key value violates unique constraint "aa_pkey"
DETAIL: Key (a)=(1) already exists.
SCHEMA NAME: public
TABLE NAME: aa
CONSTRAINT NAME: aa_pkey
LOCATION: _bt_check_unique, nbtinsert.c:398
Regards,
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message wanganshi00 2013-11-23 10:08:32 Could you give me some suopport ,thanks!
Previous Message Jeffrey Walton 2013-11-22 23:26:47 Re: fe-secure.c and SSL/TLS