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 02:58:26
Message-ID: 1128653906.20831.244611357@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you for the reply!

> > Triggers are still fired although option --disable-triggers is applied
> > to pg_restore. The fired triggers abort pg_restore because of the
> > foreign keys violations.
[snip]
> > pg_restore -l db1 >list
> > createdb -E UNICODE db1
> > pg_restore -F c -L list -v -d db1 -s db1 >log-schema 2>&1
> > pg_restore -F c -L list -v -d db1 -a --disable-triggers db1 >log-data
>
> You are DB-Superuser?
>
> Presently, the commands emitted for --disable-triggers must
> be done as superuser. So, you should also specify a supe-
> ruser name with -S, or preferably run pg_restore as a Post-
> greSQL superuser.

I am using PostgreSQL superuser doing this.

I notice that PostgreSQL does disable triggers but it seems to not
disable CHECK constraint:

CREATE TABLE table1 (
CHECK(VerifyFunc(c2,c3)),
c1 VARCHAR(20),
c2 VARCHAR(20),
c3 "char" NOT NULL
)WITHOUT OIDS;

pg_restore: disabling triggers
pg_restore: restoring data for table "table2"
pg_restore: enabling triggers
pg_restore: disabling triggers
pg_restore: restoring data for table "table1"
pg_restore: ERROR: <Exception raised by VerifyFunc()>
CONTEXT: COPY table1, line 1: "100000 q1 X"
pg_restore: [archiver (db)] error returned by PQendcopy
pg_restore: *** aborted because of error

--
http://www.fastmail.fm - IMAP accessible web-mail

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-10-07 03:00:58 Re: PostgreSQL 8.1 vs. MySQL 5.0?
Previous Message Joshua D. Drake 2005-10-07 02:30:32 Re: PostgreSQL 8.1 vs. MySQL 5.0?