Re: pg_restore --disable-triggers does not stop triggers

From: "CN" <cnliou9(at)fastmail(dot)fm>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_restore --disable-triggers does not stop triggers
Date: 2005-10-07 11:29:27
Message-ID: 1128684567.28473.244633640@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom,

Thank you very much for the enlightenment again!

> > I notice that PostgreSQL does disable triggers but it seems to not
> > disable CHECK constraint:
>
> Why should it?
>
> (Hint: a check constraint that looks at anything but the row being
> checked is broken by definition.)

Maybe my case is rare in the real world, but this is my problem:

I use CHECK(MyFunc(column_1,column_2)) because foreign key constraint is
insufficient to do the complicate check for that table. Such design
works well for production run but problem happens during database
restore. It happens because MyFunc() raises exception as the data of
this table with CHECK constraint is being restored before the data of
the table(s) referenced by MyFunc().

Is it a wise request for one more option to be added to pg_restore to
disable CHECK constraint?

Best Regards,

CN

--
http://www.fastmail.fm - Accessible with your email software
or over the web

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Moises Alberto Lindo Gutarra 2005-10-07 11:40:12 Re: How to delete Large Object from Database?
Previous Message Martijn van Oosterhout 2005-10-07 09:36:27 Re: Shell script to extract a table from a plain text dump