Re: almost there on a design

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Dennis Gearon <gearond(at)cvc(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: almost there on a design
Date: 2003-03-04 00:18:43
Message-ID: 20030303161551.C44310-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Mon, 3 Mar 2003, Dennis Gearon wrote:

> Is it possible to do 'cross constraints' between two tables using a transaction and:
>
> SETCONSTRAINTSALLDEFERRED;
>
> Or making both tables INITIALLY DEFERRED?

You make constraints INITIALLY DEFERRED, but yes in general, although
technically you only need to make one of the constraints deferred unless
you don't want to constraint the order that the rows are made.

PostgreSQL doesn't support deferred check constraints, and in general the
deferred trigger stuff isn't really meant for end-user use (it's really
there for supporting foreign keys), so you'll probably want to make the
foreign key from usremailaddrs->usrs be initially deferred and insert the
usremailaddrs row first.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2003-03-04 00:19:36 Re: Hosting a data file on a SAN
Previous Message Dennis Gearon 2003-03-04 00:02:59 Re: almost there on a design