Re: CREATE TABLE with REFERENCE - Mailing list pgsql-general

From Dmitry Tkach
Subject Re: CREATE TABLE with REFERENCE
Date
Msg-id 3F257DFD.4060808@openratings.com
Whole thread Raw
In response to CREATE TABLE with REFERENCE  (kay-uwe.genz <kug1977@web.de>)
Responses Re: CREATE TABLE with REFERENCE
List pgsql-general
Jonathan Bartlett wrote:

>Why not just drop the "references" clause?  I mean, the point of having
>transactions is to guarantee integrity within a transaction, if you're not
>going to have that, why even bother with the clause?
>
Quite the opposite - the point is to guaratee the integrity *outside*
the transaction.

You can set the constraints to be 'deferred', so that the referential
integrity only gets verified at the time you commit your transaction-
this way you can allow 'temporary' violations of the constraints inside
your transactions, while still being guaranteed that all the data that
actually gets committed satisfies all of your constraints.

>
>Most of my databases don't even user "references", just because I like the
>flexibility, and I have multitable keys (keys that can refer to rows from
>multiple tables).
>
>
Not much to brag about :-)

Dima



pgsql-general by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: Re: CREATE TABLE with REFERENCE
Next
From: Bruce Momjian
Date:
Subject: Re: Using YY-MM-DD date input