Re: thoughts about constraint trigger

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Adrian von Bidder <avbidder(at)fortytwo(dot)ch>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: thoughts about constraint trigger
Date: 2010-06-15 06:03:49
Message-ID: 4C1717C5.7000500@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message M. Bashir Al-Noimi 2010-06-15 06:47:18 Re: Does enterprisedb.com down?
Previous Message M. Bashir Al-Noimi 2010-06-15 05:26:01 Re: Problem serving one-click installer to Syria