Re: BUG #11107: UPDATE violates table check constraint

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #11107: UPDATE violates table check constraint
Date: 2014-08-01 15:59:37
Message-ID: 1406908777449-5813541.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane-2 wrote
> jesse.denardo@

> writes:
>> After creating two test tables and a table check constraint on one of
>> them,
>> I use an UPDATE statement to update one of the rows. This update causes
>> the
>> row to violate the check constraint, but the update succeeds anyways.
>> Dropping and re-adding the check constraint then fails because the
>> constraint is violated.
>
> Sorry, but this check constraint has entirely undefined behavior, as does
> any check constraint that refers to data rows other than the one that is
> being checked.

Which is why PostgreSQL has CREATE TRIGGER functionality...

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11107-UPDATE-violates-table-check-constraint-tp5813528p5813541.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Marko Tiikkaja 2014-08-01 17:01:54 Re: BUG #11107: UPDATE violates table check constraint
Previous Message Andrew Sackville-West 2014-08-01 15:46:43 Re: regression, deadlock in high frequency single-row UPDATE