From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11107: UPDATE violates table check constraint
Date: Fri, 1 Aug 2014 08:59:37 -0700 (PDT)
Message-ID: <1406908777449-5813541.post@n5.nabble.com> (raw)
In-Reply-To: <1470.1406907007@sss.pgh.pa.us>
References: <20140801133013.2696.41347@wrigleys.postgresql.org>
<1470.1406907007@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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-tp5813528p5...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: david.g.johnston@gmail.com
Subject: Re: BUG #11107: UPDATE violates table check constraint
In-Reply-To: <1406908777449-5813541.post@n5.nabble.com>
References: <20140801133013.2696.41347@wrigleys.postgresql.org> <1470.1406907007@sss.pgh.pa.us> <1406908777449-5813541.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox