Re: [HACKERS] CONSTRAINTS... - Mailing list pgsql-hackers

From Hal Snyder
Subject Re: [HACKERS] CONSTRAINTS...
Date
Msg-id 87zp7pghr1.fsf@hippo.roxor.org
Whole thread Raw
In response to CONSTRAINTS...  ("Jackson, DeJuan" <djackson@cpsgroup.com>)
List pgsql-hackers
"Jackson, DeJuan" <djackson@cpsgroup.com> writes:

> So, could someone send me the SQL92 constraints syntax as well as the
> definition of what a deferrable constraint is supposed to be?

Maybe someone emailed you a good answer already...

There's a whole chapter on constraints in "A Guide to the SQL
Standard" 4th ed. by Date and Darwen. Constraint syntax includes
CREATE DOMAIN, ALTER DOMAIN, DROP DOMAIN, CREATE ASSERTION, DROP
ASSERTION, CREATE TABLE, ALTER TABLE, FOREIGN KEY, CHECK, and SET
CONSTRAINTS, and others.

A deferrable constraint is one that may be deferred,using INITIALLY
DEFERRED or DEFERRABLE in its definition, or later, using SET
CONSTRAINTS ... DEFERRED.

A constraint is presumably deferred until a) the end of the applicable
transaction, or b) the next COMMIT, or c) the next SET CONSTRAINTS
... IMMEDIATE, whichever comes first. A possible use of deferrable
constraints is to avoid Catch-22 when setting up tables which have
cyclic dependency among foreign keys. [SQL lawyers, check me on this.]

BTW, AltaVista Web search on "sql92 ~ constraint" yielded 8 hits -
7 of which were PostgreSQL items.




pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] JOIN syntax. Examples?
Next
From: Vadim Mikheev
Date:
Subject: Re: WG: [HACKERS] MVCC works in serialized mode!