Re: pg_restore --disable-triggers does not stop triggers - Mailing list pgsql-general

From CN
Subject Re: pg_restore --disable-triggers does not stop triggers
Date
Msg-id 1128653906.20831.244611357@webmail.messagingengine.com
Whole thread Raw
In response to Re: pg_restore --disable-triggers does not stop triggers  ("A. Kretschmer" <akretschmer@despammed.com>)
Responses Re: pg_restore --disable-triggers does not stop triggers
List 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


pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: PostgreSQL 8.1 vs. MySQL 5.0?
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL 8.1 vs. MySQL 5.0?