X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C1518475A8D for ; Tue, 22 Apr 2003 01:32:17 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id DF923474E42 for ; Tue, 22 Apr 2003 01:32:16 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3M5WAU6000590; Tue, 22 Apr 2003 01:32:10 -0400 (EDT) To: "John M. Layman" Cc: pgsql-admin@postgresql.org Subject: Re: trouble migrating large objects from 7.1.3 to 7.3.2 In-reply-to: <000701c30886$d4daba10$0400a8c0@frijid.net> References: <000801c307c8$3950dc00$0400a8c0@frijid.net> <001d01c3083e$e4f26030$0400a8c0@frijid.net> <19017.1050977647@sss.pgh.pa.us> <000701c30886$d4daba10$0400a8c0@frijid.net> Comments: In-reply-to "John M. Layman" message dated "Tue, 22 Apr 2003 00:22:42 -0400" Date: Tue, 22 Apr 2003 01:32:09 -0400 Message-ID: <589.1050989529@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-30.2 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,WEIRD_QUOTING autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/295 X-Sequence-Number: 8450 "John M. Layman" writes: > [ various problems... ] > pg_restore: [archiver (db)] could not execute query: ERROR: Relation > "disc_idx_seq" does not exist I couldn't reproduce this running the dump file you were kind enough to send me off-list. > I tried dropping the sequence & re-running the restore, but that just got me > into more trouble. I'm guessing that I should let pg_restore create the > database for me (instead of issuing a createdb command), Not necessarily, but you do usually want to start from an empty database --- dropping just one object is not going to work. > but I can't get the -c or -C options to work. I think this is mostly pilot error, probably compounded by insufficiently clear explanations in the docs. It might help to think about what each of these switches actually does. "-c" simply causes pg_restore to issue a "DROP foo" command immediately before each of its "CREATE foo" commands. (That's at the individual-object level, I don't think it applies to the whole database.) This switch strikes me as of little use --- it's always faster to just drop the whole database before you start the restore. (I suppose it might come in handy for certain kinds of database-merge operations, though.) What the "-C" switch does is cause pg_restore to issue a "CREATE DATABASE dbname" and then "\connect dbname" before it starts restoring individual objects. The gotcha here is you cannot say "-d dbname" in the pg_restore command line, because dbname doesn't exist yet. You have to tell it to initially connect to some DB that *does* exist, from whence it can issue the CREATE DATABASE command. So usually "-C" would go along with "-d template1". (If you can think of a better way to explain all this, patches for the documentation would be most welcome.) > pg_restore: [archiver (db)] connection to database "dbase" failed: FATAL: > parser zero-length delimited identifier at or near """" at character 47 This error confuses me though --- it doesn't square with the above considerations, and I couldn't reproduce it with your schema dump. Could you try it with statement logging enabled, and look to see exactly what commands pg_restore issued that led up to the failure? regards, tom lane