Re: Changing constraints to deferrable

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Changing constraints to deferrable
Date: 2005-03-23 14:00:57
Message-ID: 42417699.8030403@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Stark wrote:
> I want all my foreign key constraints to be deferrable. They were all created
> with the default (not deferrable).
>
> Is it enough to just do
>
> update pg_constraint set condeferrable = 't' where contype = 'f';

No - the constraints are actually enforced by triggers - Just just
normally don't see those triggers - but if you look into pg_triggers,
you'll find them. The have "tgisconstraint" set to true, so it should
be easy to find them.

Try an additional "update pg_trigger set isdeferrable=true where
pgisconstraint = true", and it should work..

I'm not etirely sure about the fieldnames - so better check them - e.g
"\d pg_catalog.pg_trigger" could help, when typed into psql ;-)

mfg, Florian Pflug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lonni J Friedman 2005-03-23 14:05:40 Re: postgres oracle emulation question
Previous Message Shaun Clements 2005-03-23 13:51:57 FW: PLPGSQL