Re: CREATE TABLE with REFERENCE

From: Dmitry Tkach <dmitry(at)openratings(dot)com>
To: Jonathan Bartlett <johnnyb(at)eskimo(dot)com>
Cc: "kay-uwe(dot)genz" <kug1977(at)web(dot)de>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: CREATE TABLE with REFERENCE
Date: 2003-07-28 19:48:13
Message-ID: 3F257DFD.4060808@openratings.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-07-28 19:48:39 Re: Using YY-MM-DD date input
Previous Message Bruce Momjian 2003-07-28 19:48:02 Re: Using YY-MM-DD date input