Re: how to temporally disable foreign key constraint check

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: how to temporally disable foreign key constraint check
Дата
Msg-id 4EA2057F.3000002@ringerc.id.au
обсуждение исходный текст
Ответ на how to temporally disable foreign key constraint check  (Emi Lu <emilu@encs.concordia.ca>)
Список pgsql-sql
On 10/21/2011 09:36 PM, Emi Lu wrote:
> 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

If you really, really want to do this you can do it by disabling the 
triggers that enforce the checks on particular tables. This must be done 
table-by-table, there's no global way to do it.

Use ALTER TABLE ... DISABLE TRIGGER to do it. See:

http://www.postgresql.org/docs/current/static/sql-altertable.html

--
Craig Ringer



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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: how to temporally disable foreign key constraint check
Следующее
От: Linos
Дата:
Сообщение: advice on how to store variable attributes