Re: Duplicate key value error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Vlad Arkhipov <arhipov(at)dc(dot)baikal(dot)ru>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Duplicate key value error
Date: 2009-04-04 22:58:04
Message-ID: 24655.1238885884@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> Vlad Arkhipov <arhipov(at)dc(dot)baikal(dot)ru> wrote:
>> Is it possible to print which key value is duplicated when 'Duplicate
>> key value violates unique constraint' occurs? Foreign key violation
>> error reports such kind of information.

> If no objection, I'd like to submit the patch to the next commit-fest (8.5).

I added this to CommitFest-2009-First. One comment is that I'd prefer
to refactor this so it's not btree-specific, but could be used by other
index AMs. I'm not quite sure where to put the code instead, though.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-04-04 23:04:56 Re: ALTER TABLE ... ALTER COLUMN ... SET DISTINCT
Previous Message Tom Lane 2009-04-04 22:25:10 Re: Review: B-Tree emulation for GIN