Re: Temporally disabled foreign key constraint check?

Поиск
Список
Период
Сортировка
Искать
От
Andreas Kretschmer
Тема
Re: Temporally disabled foreign key constraint check?
Дата
Msg-id
98541615.95.1319210554250.JavaMail.open-xchange@oxweb01.ims-firmen.de
Ответ на
Список
Дерево обсуждения
Temporally disabled foreign key constraint check? Emi Lu <emilu@encs.concordia.ca>
Re: Temporally disabled foreign key constraint check? raghu ram <raghuchennuru@gmail.com>
Re: Temporally disabled foreign key constraint check? Emi Lu <emilu@encs.concordia.ca>
Re: Temporally disabled foreign key constraint check? raghu ram <raghuchennuru@gmail.com>
Re: Temporally disabled foreign key constraint check? Andreas Kretschmer <akretschmer@spamfence.net>



raghu ram  hat am 21. Oktober 2011 um 17:12
geschrieben:


> 
> 
> On Fri, Oct 21, 2011 at 8:33 PM, Emi Luwrote:
> 
> > Good morning,
> > 
> > 
> > Is there a way to temporally disabled foreign key constraints something
> > like:
> > 
> > SET FOREIGN_KEY_CHECKS=0
> > 
> > When population is done, will set FOREIGN_KEY_CHECKS=1
> > 
> > 
You can disable *triggers* on a table (which will disable all the FK
constraints, but not things like 'not nul' or 'unique').
> For Disable:
> update pg_class set reltriggers=0 where relname = 'TEST';
> For Enable:
> update pg_class set reltriggers = count(*) from pg_trigger where
> pg_class.oid=tgrelid and relname='TEST';
> 
> 

 
 
 
No, don't manipulate pg_* - tables. Use instead ALTER TABLE ... DISABLE TRIGGER
...
 
 
Regards, Andreas 

>  
> --Raghu 
> 
>
В списке pgsql-general по дате отправления
От: raghu ram
Дата:
От: Emi Lu
Дата:
FAQ