Re: Duplicate key error when updating unique columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Duplicate key error when updating unique columns
Date: 2005-05-06 16:10:50
Message-ID: 15269.1115395850@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Glaesemann <grzm(at)myrealbox(dot)com> writes:
> I thought that the unique key would be checked at the end of the update
> statement:

No, it's never worked that way. Each row is checked as it is inserted.
With an example like this, you may or may not get a failure depending on
chance physical ordering of rows.

This is not per spec, and I believe we have a TODO to fix it, but a fix
is far from trivial.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Wilson 2005-05-06 16:42:38 Re: Slony v. DBMirror
Previous Message Andrew Sullivan 2005-05-06 16:09:45 Re: Slony v. DBMirror