pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rod Taylor <rbt@rbt.ca>
Cc: Kuhn, Dylan K (4520500D) <Dylan.Kuhn@navy.mil>
Cc: pgsql-admin@postgresql.org, PostgreSQL Development <pgsql-hackers@postgresql.org>
Subject: Re: problems with pg_restore
Date: Tue, 15 Jul 2003 16:03:13 -0400
Message-ID: <8299.1058299393@sss.pgh.pa.us> (raw)
In-Reply-To: <1058298650.9981.117.camel@jester>
References: <78ED1F30F0D85B4698FBD6CF2A5AC8F5A576F9@NAWECHLKEX01VA.nadsuswe.nads.navy.mil>
	<23211.1058286389@sss.pgh.pa.us>
	<1058298650.9981.117.camel@jester>

Rod Taylor <rbt@rbt.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



view thread (12+ messages)  latest in thread

Message-ID: <8299.1058299393@sss.pgh.pa.us>
Permalink:  ../8299.1058299393@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8299.1058299393@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rbt@rbt.ca, Dylan.Kuhn@navy.mil, pgsql-hackers@postgresql.org
  Subject: Re: problems with pg_restore
  In-Reply-To: <8299.1058299393@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