Re: problems with pg_restore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: "Kuhn, Dylan K (4520500D)" <Dylan(dot)Kuhn(at)navy(dot)mil>, pgsql-admin(at)postgresql(dot)org, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: problems with pg_restore
Date: 2003-07-15 20:03:13
Message-ID: 8299.1058299393@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Rod Taylor <rbt(at)rbt(dot)ca> writes:
>> Hackers: this seems like an extremely bad side-effect of what we thought
>> was a simple addition of a helpful check. I am thinking we should
>> either remove the check again, or downgrade it to a WARNING (though I'm
>> not quite sure how to phrase the warning ...). Any thoughts?

> How about going the other way and removing the requirement to explicitly
> state the database?
> COMMENT ON DATABASE IS 'This comment is on the current database.';

Won't help us for reading existing pg_dump scripts, although perhaps it
would be useful going forward.

Given the current implementation, it seems like there are three possible
behaviors for COMMENT ON DATABASE when the database name isn't the same
as the current database:

1. Raise error (what we're doing now). Simple but breaks dump scripts
for the restore-into-different-DB scenario.

2. Do nothing, store the comment in the current DB's pg_description
(what we did in 7.2). Now that I think about it, this also fails
for different-database restore, since very possibly the attempt
to look up the DB name will fail --- you'll get a no-such-database
error instead of the present error, but it's still unhelpful.

3. Ignore the specified DB name, store the comment as the description
of the current DB; possibly give a warning saying we're doing so.
This would allow correct restoration of dumps into different DBs,
but I think people would find it awfully surprising :-(

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Kuhn, Dylan K (4520500D) 2003-07-15 20:26:37 Re: problems with pg_restore
Previous Message Rod Taylor 2003-07-15 19:50:51 Re: problems with pg_restore

Browse pgsql-hackers by date

  From Date Subject
Next Message Kurt Roeckx 2003-07-15 20:14:38 Re: OSF build fixed
Previous Message Rod Taylor 2003-07-15 19:50:51 Re: problems with pg_restore