Re: BUG #5606: DEFERRABLE and DEFERRABLE INITIALLY DEFERRED are the same - Mailing list pgsql-bugs

From Frank Heikens
Subject Re: BUG #5606: DEFERRABLE and DEFERRABLE INITIALLY DEFERRED are the same
Date
Msg-id 168F24367E861A4698E58C183F317D0B04802BE671@anva-mail07.anva.amt
Whole thread Raw
In response to Re: BUG #5606: DEFERRABLE and DEFERRABLE INITIALLY DEFERRED are the same  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The manual looks fine, I found the information as well. I started using the=
 wiki, that's why I got confused.

Thanks!

Frank

-----Oorspronkelijk bericht-----
Van: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Verzonden: vrijdag 6 augustus 2010 17:04
Aan: Frank Heikens
CC: pgsql-bugs@postgresql.org
Onderwerp: Re: [BUGS] BUG #5606: DEFERRABLE and DEFERRABLE INITIALLY DEFERR=
ED are the same

Frank Heikens <f.heikens@anva.nl> writes:
> The wikipage says
>> a deferrable constraint CAN be checked at the end of a
>> transaction. You still have to ask PostgreSQL to defer it.
> http://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.0#DEFERRABLE=
_UNIQUE_CONSTRAINTS

> I don't have to ask PostgreSQL to defer, it works in the second test
as well in the third test without any changes. I guess the example in
the wiki isn't correct, right?

No, not even a little bit :-(.  I hadn't seen that text; it needs to be
corrected.  Will hack on it in a moment.

> A single UPDATE touching all records will check the uniqueness after the =
complete update, not right after each update of a row as it does on non-def=
errable constraints.

Right.
non-deferrable -> uniqueness is enforced after each row change
DEFERRABLE IMMEDIATE -> uniqueness is enforced at end of statement
DEFERRABLE DEFERRED -> uniqueness is enforced at end of transaction

> Maybe someone could make this clear in the manual and wiki?

AFAIK the manual is OK; do you see a place where it gets this wrong?

                        regards, tom lane

***************************DISCLAIMER***********************************
Deze e-mail is uitsluitend bestemd voor de geadresseerde(n). Verstrekking a=
an en gebruik door anderen is niet toegestaan. ANVA bv sluit iedere aanspra=
kelijkheid uit die voortvloeit uit electronische verzending.

This e-mail is intended exclusively for the addressee(s), and may not be pa=
ssed on to, or made available for use by any person other than the addresse=
e(s). ANVA bv rules out any and every liability resulting from any electron=
ic transmission.
***************************************************************************=
***

pgsql-bugs by date:

Previous
From: Frank Heikens
Date:
Subject: Re: BUG #5606: DEFERRABLE and DEFERRABLE INITIALLY DEFERRED are the same
Next
From: Michael Meskes
Date:
Subject: Re: BUG #5607: memmory leak in ecpg