Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 66D024768E4 for ; Thu, 15 Aug 2002 00:03:02 -0400 (EDT) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id F1D964768D5 for ; Thu, 15 Aug 2002 00:03:01 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id 8EB4138192B; Thu, 15 Aug 2002 00:03:00 -0400 (EDT) From: davidh@anstat.com.au (David Hsu) X-Newsgroups: comp.databases.postgresql.admin Subject: pg_restore does not restore/recreate indices Date: 14 Aug 2002 20:55:11 -0700 Organization: http://groups.google.com/ Lines: 66 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-admin@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/227 X-Sequence-Number: 5341 Hi All, I've just started using postgres and I cannot seem to get a full dump/restore happening with pg_restore's custom format. It seems to always complain that it cannot drop the indices (of course!) but somehow stops at the error and refuse the continue. To dump I used: [root]# pg_dump -Fc -Upostgres db_name -f /tmp/dump.pgc To restore (to another server) I used: [root]# pg_restore -v -Fc -Upostgres -c -ddb_name dump.pgc pg_restore: connecting to database for restore Password: pg_restore: dropping INDEX "ix_document_by_title" pg_restore: [archiver (db)] could not execute query: ERROR: index "ix_document_by_title" does not exist pg_restore: *** aborted because of error It seems it tries to drop the non-existent index, and STOPs at the error. It's the same with or without the '-c' flag. I cannot not seem to find anything relating to "ignore-erros-continue". The same problem seems to exist for the tar format. The only format seems to work is the default dump into script. However I cannot "easily" restore selective table this way. :( Any suggestion appreciated / welcome. My system info: RH 7.3 2.4.18-4smp #1 SMP Thu May 2 18:32:34 EDT 2002 i686 unknown postgresql-server-7.2.1-2PGDG postgresql-jdbc-7.2.1-5 postgresql-libs-7.2.1-5 postgresql-7.2.1-5 David Hsu ps. the -i / --index= flags do not seem to work at all (and in fact returns different messages ?!@#$@#$) [root]# pg_restore -v -Upostgres -ddb_name -i ix_document_by_title dump.pgc pg_restore: connecting to database for restore Password: pg_restore: creating TABLE actcategories pg_restore: [archiver (db)] could not execute query: ERROR: Relation 'actcategories' already exists pg_restore: *** aborted because of error [root]# pg_restore -v -Upostgres -ddb_name --index=ix_document_by_title dump.pgc pg_restore: connecting to database for restore Password: pg_restore: implied data-only restore [root]# pg_restore -v -Upostgres -ddb_name -iix_document_by_title dump.pgc pg_restore: connecting to database for restore Password: pg_restore: creating TABLE actcategories pg_restore: [archiver (db)] could not execute query: ERROR: Relation 'actcategories' already exists pg_restore: *** aborted because of error