X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 74D28CC472 for ; Tue, 15 Jul 2003 20:02:45 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 09128-03 for ; Tue, 15 Jul 2003 20:03:12 +0000 (GMT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 17E58CC422 for ; Tue, 15 Jul 2003 17:02:44 -0300 (ADT) 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 h6FK3DQ3008300; Tue, 15 Jul 2003 16:03:13 -0400 (EDT) To: Rod Taylor Cc: "Kuhn, Dylan K (4520500D)" , pgsql-admin@postgresql.org, PostgreSQL Development Subject: Re: problems with pg_restore 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> Comments: In-reply-to Rod Taylor message dated "15 Jul 2003 19:50:51 -0000" Date: Tue, 15 Jul 2003 16:03:13 -0400 Message-ID: <8299.1058299393@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/139 X-Sequence-Number: 9479 Rod Taylor 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