Skip site navigation (1) Skip section navigation (2)

Re: BUG #1266: Improper unique constraint / MVCCactivitieswithin

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Aleksey Fedorchenko <alexey_f(at)ukr(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1266: Improper unique constraint / MVCCactivitieswithin
Date: 2004-09-26 18:11:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On Sun, 26 Sep 2004, Aleksey Fedorchenko wrote:

> As i told, under pgAdmin's console and PHP it fails anyway but psql
> falls only with function invocation.

Hmm, for PHP was it sent as one big string with all the statements or a
separate statements?  There's a side issue that I believe you can send
multiple statements in one query string, but they're treated specially if
you do so.

> > In the former case there's a reading of spec
> > question for the timing of the actions (are they on the statement or at
> > check time -- we've done the latter although a rereading implies that we
> > may have previously read it wrong) and the latter, up until Tom's very
> > recent patch, any AFTER triggers (or foreign keys) waited until the end of
> > the original statement from the user to run.
> I misunderstood this sentence... Do you wanna told me that within single
> statements batch there could be non-serializable execution? If true then
> it seems to be a architectual issue (i could expect parallel execution
> within single sql statement but all constraints have to be checked right
> after it finished - not before and not after, just at a statement
> execution finish moment). Otherwise it is a bug anyway, imho.

What I'm saying is that, constraints are checked at end of statement.  In
current releases (8.0b2 included I believe but not 8.0b3) functions are
considered part of the statement that called them, so the constraints are
check at the end of the full outer statement that called the function.
8.0b3 should change this so that the inner statements are considered
separately. In addition, referential actions are currently (but may not be
in 8.0 final) considered to occur at constraint check time, which means
for a deferred constraint, at end of transaction or when set constraints
is used to make the constraint immediate.  The reason the latter may
change is that with rereading the spec we are not sure if that is actually
what the spec intends and are still investigating that.

In response to


pgsql-bugs by date

Next:From: Stephan SzaboDate: 2004-09-26 18:15:25
Subject: Re: BUG #1266: Improper unique constraint / MVCCactivitieswithin
Previous:From: Aleksey FedorchenkoDate: 2004-09-26 18:09:41
Subject: Re: BUG #1266: Improper unique constraint / MVCCactivitieswithin single transaction - addendum

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group