Re: Posgres Query for Foreign Key Check

From: Jerry Sievers <gsievers19(at)comcast(dot)net>
To: Jerry Sievers <gsievers19(at)comcast(dot)net>
Cc: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>, Ankur Kaushik <ankurk(at)trimax(dot)in>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Posgres Query for Foreign Key Check
Date: 2015-03-19 17:50:23
Message-ID: 86pp84khb4.fsf@jerry.enova.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Jerry Sievers <gsievers19(at)comcast(dot)net> writes:

> Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com> writes:
>
>> On Thu, Mar 19, 2015 at 5:49 AM, Ankur Kaushik <ankurk(at)trimax(dot)in> 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(at)trimax(dot)in and delete all copies.
>>

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres(dot)consulting(at)comcast(dot)net
p: 312.241.7800

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Vladimir Borodin 2015-03-20 15:00:16 Re: [pgadmin-support] Issue with a hanging apply process on the replica db after vacuum works on primary
Previous Message Jerry Sievers 2015-03-19 17:45:37 Re: Posgres Query for Foreign Key Check