Re: order of checking the unique constraints

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
Cc: "Sahagian, David" <david(dot)sahagian(at)emc(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: order of checking the unique constraints
Date: 2012-08-29 08:55:34
Message-ID: CAL_0b1t3G_HttdsfSNGywU5rrYzsM1UcXsJpdMOaS6XjusFoLg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> Can somebody tell me the order in which the Unique Constraints of a table
>> are checked, like when an INSERT is done ?
>
> I had a similar question some time ago, with an answer by Tom lane:
> http://archives.postgresql.org/pgsql-general/2012-03/msg00023.php

You might also find interesting that this behavior can be controlled
by specifying DEFERRABLE/IMEDIATE properties on your UCs and by using
SET CONSTRAINTS dirrective.

http://www.postgresql.org/docs/9.1/interactive/sql-set-constraints.html

--
Sergey Konoplev

a database and software architect
http://www.linkedin.com/in/grayhemp

Jabber: gray(dot)ru(at)gmail(dot)com Skype: gray-hemp Phone: +79160686204

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kent Tong 2012-08-29 11:19:00 do the files in pg_xlog differ in master and slave?
Previous Message Sergey Konoplev 2012-08-29 08:35:27 Re: Dropping a column on parent table doesn't propagate to children?