Re: Duplicate key error when updating unique columns - Mailing list pgsql-general

From Tom Lane
Subject Re: Duplicate key error when updating unique columns
Date
Msg-id 15269.1115395850@sss.pgh.pa.us
Whole thread Raw
In response to Duplicate key error when updating unique columns  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: Duplicate key error when updating unique columns
List pgsql-general
Michael Glaesemann <grzm@myrealbox.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

pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Slony v. DBMirror
Next
From: Peter Wilson
Date:
Subject: Re: Slony v. DBMirror