From: Tom Lane <tgl@sss.pgh.pa.us>
To: John M. Layman <jml@frijid.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: trouble migrating large objects from 7.1.3 to 7.3.2
Date: Tue, 22 Apr 2003 01:32:09 -0400
Message-ID: <589.1050989529@sss.pgh.pa.us> (raw)
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>
"John M. Layman" <jml@frijid.net> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, jml@frijid.net
Subject: Re: trouble migrating large objects from 7.1.3 to 7.3.2
In-Reply-To: <589.1050989529@sss.pgh.pa.us>
References: <000801c307c8$3950dc00$0400a8c0@frijid.net> <001d01c3083e$e4f26030$0400a8c0@frijid.net> <19017.1050977647@sss.pgh.pa.us> <000701c30886$d4daba10$0400a8c0@frijid.net> <589.1050989529@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox