Posgres Query for Foreign Key Check
Posgres Query for Foreign Key Check
От:
"Ankur Kaushik" <ankurk@trimax.in>
Дата:
Hi ,
We are in Process of migration our Database from Mysql to Postgres .
I want ot know How I can disable foreign key check in posgres just as in MySQL set session foreign_key_checks=0;
Regards
Ankur
DBA | Trimax Infrastructure
Disclaimer: This e-mail may contain material that is confidential, privileged and product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender or legal@trimax.in and delete all copies.
Re: Posgres Query for Foreign Key Check
От:
Raghavendra <raghavendra.rao@enterprisedb.com>
Дата:
Hi ,
We are in Process of migration our Database from Mysql to Postgres .
I want ot know How I can disable foreign key check in posgres just as in MySQL set session foreign_key_checks=0;
Try.
ALTER TABLE table_name DISABLE TRIGGER ALL;
Regards
Ankur
DBA | Trimax Infrastructure
Disclaimer: This e-mail may contain material that is confidential, privileged and product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender or legal@trimax.in and delete all copies.
Re: Posgres Query for Foreign Key Check
От:
Jerry Sievers <gsievers19@comcast.net>
Дата:
Raghavendra writes: > On Thu, Mar 19, 2015 at 5:49 AM, Ankur Kaushik wrote: > > Hi , > > Â > > We are in Process of migration our Database from Mysql to Postgres . > > Â > > I want ot know How I can disable foreign key check in posgres just as in MySQL set session foreign_key_checks=0; > > Â > > âTry.â > > âALTER TABLE table_name DISABLE TRIGGER ALL;Â Yeah but really *good* platforms like MySQL let you totally screw your whole DB with just one easy command. Why can't Postgres suck like that? FWIW > > http://www.postgresql.org/docs/9.3/static/sql-altertable.html > > --- > Regards, > Raghavendra > EnterpriseDB Corporation > Blog:Â http://raghavt.blogspot.com/ > Â > > Regards > > Ankur > > DBA | Trimax Infrastructure > > Disclaimer: This e-mail may contain material that is confidential, privileged and product for the sole use of the intended recipient. Any review, reliance or > distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender or > legal@trimax.in and delete all copies. > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800
Re: Posgres Query for Foreign Key Check
От:
Jerry Sievers <gsievers19@comcast.net>
Дата:
Jerry Sievers writes: > Raghavendra writes: > >> On Thu, Mar 19, 2015 at 5:49 AM, Ankur Kaushik wrote: >> >> Hi , >> >> Â >> >> We are in Process of migration our Database from Mysql to Postgres . >> >> Â >> >> I want ot know How I can disable foreign key check in posgres just as in MySQL set session foreign_key_checks=0; >> >> Â >> >> âTry.â >> >> âALTER TABLE table_name DISABLE TRIGGER ALL;Â > > Yeah but really *good* platforms like MySQL let you totally screw your > whole DB with just one easy command. > > Why can't Postgres suck like that? Oops! It can if you subvert session_replication_role :-) I'll leave doing the details as a user exercise. > > FWIW > > >> >> http://www.postgresql.org/docs/9.3/static/sql-altertable.html >> >> --- >> Regards, >> Raghavendra >> EnterpriseDB Corporation >> Blog:Â http://raghavt.blogspot.com/ >> Â >> >> Regards >> >> Ankur >> >> DBA | Trimax Infrastructure >> >> Disclaimer: This e-mail may contain material that is confidential, privileged and product for the sole use of the intended recipient. Any review, reliance or >> distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender or >> legal@trimax.in and delete all copies. >> -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800