Re: BUG #3910: Incorrect behavior of UPDATE statement on tables with constraints UNIQUE/PRIMARY KEY - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #3910: Incorrect behavior of UPDATE statement on tables with constraints UNIQUE/PRIMARY KEY
Date
Msg-id 20080129131207.GD5178@alvh.no-ip.org
Whole thread Raw
In response to BUG #3910: Incorrect behavior of UPDATE statement on tables with constraints UNIQUE/PRIMARY KEY  ("Dmitry Afanasiev" <KOT@MATPOCKuH.Ru>)
List pgsql-bugs
Dmitry Afanasiev wrote:

> Constraints must be checked AFTER updating ALL of rows, but really after
> every row.
> For illustrate try this simple sql script:
> CREATE TABLE n(n INTEGER PRIMARY KEY);
> INSERT INTO n VALUES(1);
> INSERT INTO n VALUES(2);
> INSERT INTO n VALUES(3);
> UPDATE n SET n = n + 1;

Yes.  This is a known problem.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-bugs by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Bugs
Next
From: David Fetter
Date:
Subject: Re: BUG #3910: Incorrect behavior of UPDATE statement on tables with constraints UNIQUE/PRIMARY KEY