Re: can you change an FK constraint from NOT DEFERRABLE to DEFERRABLE

From: PFC <lists(at)boutiquenumerique(dot)com>
To: frank(at)joerdens(dot)de, pgsql-sql(at)postgresql(dot)org
Subject: Re: can you change an FK constraint from NOT DEFERRABLE to DEFERRABLE
Date: 2005-03-30 09:48:31
Message-ID: op.sof2u5gmth1vuj@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Checks the docs on ALTER TABLE ... ALTER CONSTRAINT ...

On Wed, 30 Mar 2005 11:07:32 +0200, <frank(at)joerdens(dot)de> wrote:

> Hello. Is it possible to change an FK constraint from NOT DEFERRABLE
> (the default) to DEFERRABLE without dropping and re-creating it? One idea
> that came up was to create a parallel set of constraints which perform
> the same checks as the existing ones as DEFERRABLE (and then drop the
> old set), but the objection there was that it'd lock the tables during
> the initial check.
>
> We're having a fairly serious deadlock issue and the thinking goes that
> Tom's suggestion here
>
> http://www.webservertalk.com/archive139-2004-8-364172.html
>
> to defer FK checks until transaction commit would maybe help. Right now
> we can't try this because all the FK checks where created with default
> settings. We'd like to avoid taking the database down for recreating
> foreign keys.
>
> Regards,
>
> Frank
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message frank 2005-03-30 10:33:11 Re: can you change an FK constraint from NOT DEFERRABLE to DEFERRABLE
Previous Message frank 2005-03-30 09:07:32 can you change an FK constraint from NOT DEFERRABLE to DEFERRABLE