Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VuYHM-0005I2-UB for pgsql-bugs@arkaria.postgresql.org; Sun, 22 Dec 2013 01:56:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VuYHL-0007iA-JF for pgsql-bugs@arkaria.postgresql.org; Sun, 22 Dec 2013 01:56:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VuYHJ-0007i1-Kb for pgsql-bugs@postgresql.org; Sun, 22 Dec 2013 01:56:25 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VuYHF-0006BU-Id for pgsql-bugs@postgresql.org; Sun, 22 Dec 2013 01:56:25 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by mahout.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VuYHD-0000QV-R4 for pgsql-bugs@postgresql.org; Sun, 22 Dec 2013 01:56:20 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.80) (envelope-from ) id 1VuYH7-0008Rz-SV for pgsql-bugs@postgresql.org; Sun, 22 Dec 2013 01:56:13 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: BUG #8695: Reloading dump fails at COMMENT ON EXTENSION plpgsql To: pgsql-bugs@postgresql.org From: chris@chrullrich.net Message-Id: Date: Sun, 22 Dec 2013 01:56:13 +0000 X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 8695 Logged by: Christian Ullrich Email address: chris@chrullrich.net PostgreSQL version: 9.3.2 Operating system: all Description: A non-superuser cannot reload any dump of a database that contains the plpgsql extension, because the dump unconditionally attempts to set the comment on that extension. This fails because plpgsql is owned by the superuser who installed it. This contradicts the manual, which says: "The dumps produced by pg_dump are relative to template0." The plpgsql extension is present in template0, with the identical comment, and therefore neither extension nor comment should be dumped at all. (I know this is splitting hairs, because pg_dump does not actually compare the subject database to template0, but still, the contradiction is there.) The extension itself is dumped as CREATE IF NOT EXISTS, so that works, but there is no conditional syntax for comments, and since pg_dump does not know whether the comment has been changed from the default, it could not use one anyway. I can think of one possible fix (aside from simply filtering that line from the dump): COMMENT could be a no-op if the requested comment is identical to the existing one. Another idea I had was to allow comments to be part of an extension, so that pg_dump would not dump them, but that does not work because pg_dump does not know if a comment has been changed from the original value. Not that anyone would ever do that. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs