Re: thoughts about constraint trigger - Mailing list pgsql-general

From Craig Ringer
Subject Re: thoughts about constraint trigger
Date
Msg-id 4C1717C5.7000500@postnewspapers.com.au
Whole thread Raw
In response to thoughts about constraint trigger  (Adrian von Bidder <avbidder@fortytwo.ch>)
Responses Re: thoughts about constraint trigger  (Adrian von Bidder <avbidder@fortytwo.ch>)
List pgsql-general
On 15/06/10 02:33, Adrian von Bidder wrote:
> Heyho!
>
> I was trying to implement a deferred NOT NULL constraint using a deferred
> constraint trigger (on update and insert of this row) because some values
> would be filled in later during the transaction, after the initial part of
> the record has been filled.

AFAIK, at this point only FOREIGN KEY constraints may be deferred.

http://www.postgresql.org/docs/current/static/sql-set-constraints.html
http://www.postgresql.org/docs/current/static/sql-createtable.html

"DEFERRABLE
NOT DEFERRABLE

    This controls whether the constraint can be deferred. A constraint
that is not deferrable will be checked immediately after every command.
Checking of constraints that are deferrable can be postponed until the
end of the transaction (using the SET CONSTRAINTS command). NOT
DEFERRABLE is the default. Only foreign key constraints currently accept
this clause. All other constraint types are not deferrable."

--
Craig Ringer

Tech-related writing: http://soapyfrogs.blogspot.com/

pgsql-general by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: Enforcing password standards
Next
From: "M. Bashir Al-Noimi"
Date:
Subject: Re: Does enterprisedb.com down?