Re: Temparary disable constraint

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Hubert FONGARNAND <informatique(dot)internet(at)fiducial(dot)fr>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Temparary disable constraint
Date: 2007-01-17 15:48:37
Message-ID: 200701171548.l0HFmbI22698@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hubert FONGARNAND wrote:
> Ok it works, but we have to write a plpgsql function that takes the
> table_name and the constraint name in parameters....
>
> It could be useful to have a : ALTER TABLE ... DISABLE CONSTRAINT ...
> (as oracle does)
>
> it could be good to add this to the TODO LIST...

Well, we currently only allow disabling foreign key constraints (those
that have triggers). There is no way to disable a UNIQUE or NOT NULL
constraint, for example, so I don't see how we can do DISABLE CONSTRAINT
cleanly.

---------------------------------------------------------------------------

>
> Thanks
>
>
>
> Le mardi 16 janvier 2007 ? 22:02 -0500, Bruce Momjian a ?crit :
>
> > Hubert FONGARNAND wrote:
> > > Hi,
> > >
> > > Is there a way to temporary disable a constraint (without drop and
> > > recreating it) in postgresql?
> >
> > Sure, try ALTER TABLE ... DISABLE TRIGGER for the constraint trigger
> > name.
> >
> _______________________________________________
> Ce message et les ?entuels documents joints peuvent contenir des informations confidentielles.
> Au cas o?il ne vous serait pas destin? nous vous remercions de bien vouloir le supprimer et en aviser imm?iatement l'exp?iteur. Toute utilisation de ce message non conforme ?sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
> Les communications sur internet n'?ant pas s?uris?s, l'int?rit?de ce message n'est pas assur? et la soci???ettrice ne peut ?re tenue pour responsable de son contenu.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-01-17 15:49:22 Re: Temparary disable constraint
Previous Message Tom Lane 2007-01-17 15:35:29 Re: Idea for fixing the Windows fsync problem