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 ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org