Thread: how should I do to disable the foreign key in postgres?

how should I do to disable the foreign key in postgres?

From
"froast"
Date:
in mysql, I used :"set foreign_key_check = 0;" to disable the foreign key check, now I'm trying to migrate from mysql to postgres, how should I do to disable it?  

Re: how should I do to disable the foreign key in postgres?

From
"Trevor Talbot"
Date:
On 11/13/07, froast <froast@qq.com> wrote:

> in mysql, I used :"set foreign_key_check = 0;" to disable the foreign key
> check, now I'm trying to migrate from mysql to postgres, how should I do to
> disable it?

PostgreSQL isn't really designed to let your data be compromised.
What actual problem are you trying to solve?  Why do you need foreign
key constraints to be ignored?

Re: how should I do to disable the foreign key in postgres?

From
"A. Kretschmer"
Date:
am  Wed, dem 14.11.2007, um 15:16:48 +0800 mailte froast folgendes:
> in mysql, I used :"set foreign_key_check = 0;" to disable the foreign key
> check, now I'm trying to migrate from mysql to postgres, how should I do
> to disable it?

You can define the constraints as deferrable. Later you can say:

set constraints all deferred ;



Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net