Re: DEFERRABLE NOT NULL constraint

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Gavan Schneider *EXTERN*" <pg-gts(at)snkmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: DEFERRABLE NOT NULL constraint
Date: 2013-02-08 08:34:54
Message-ID: A737B7A37273E048B164557ADEF4A58B057B1044@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gavan Schneider wrote:
> But I feel I have missed something here.
>
> Referring to:
> <http://www.postgresql.org/docs/current/static/sql-createtable.html>

> CHECK constraints, NOT NULL constraints and FOREIGN KEY
> constraints all look very deferrable in this definition. If
> that's the case, why are we having this discussion if the
> requested functionality/compliance is already present? (As I
> have said already) I really must have missed something so am
> standing by for the 'gotcha'... please supply :)

Further down on the page you quote, it says:

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. Currently, only UNIQUE,
PRIMARY KEY, EXCLUDE, and REFERENCES (foreign key)
constraints accept this clause.
NOT NULL and CHECK constraints are not deferrable.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Russell Keane 2013-02-08 11:37:49 Re: Visual query builder for PosgreSQL?
Previous Message Satoshi Nagayasu 2013-02-08 07:42:17 Visual query builder for PosgreSQL?