Re: Temparary disable constraint

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Temparary disable constraint
Дата
Msg-id 200701171548.l0HFmbI22698@momjian.us
обсуждение исходный текст
Ответ на Re: Temparary disable constraint  (Hubert FONGARNAND <informatique.internet@fiducial.fr>)
Список 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
partielleet 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@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Idea for fixing the Windows fsync problem
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Temparary disable constraint