Comment on extension issues with pg_dump after upgrading to 9.1.2 - Mailing list pgsql-general

From Timothy Garnett
Subject Comment on extension issues with pg_dump after upgrading to 9.1.2
Date
Msg-id CAPcyiQ0fas+4QsgDbXSFK5LsJTN3ORB=Ua3KyND5U-Ore_BTLw@mail.gmail.com
Whole thread Raw
Responses Re: Comment on extension issues with pg_dump after upgrading to 9.1.2  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
List pgsql-general
Hi All,

We recently upgraded to 9.1.2 from 9.0.3 and ran into some issues with the process we've been using to dump and restore databases.  We typically use a super user (but not the postgres user) to dump and restore databases, but in moving the 9.1.2 we've run into trouble with pg_dump outputing comment on extension lines that cause permission issues on pg_restore.

Something like:
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
COMMENT ON EXTENSION plpgsql IS '....';

The create is fine because the extension is already in the template db, but the comment causes problems because the extension is owned by the postgres user, but we're trying to use a different user (and apparently even super users can not comment on extensions owned by other users).  This happens even if the comment isn't changing.  There also appears to be no way to change the ownership of an extension.  We have the same issue with other extensions.  So far we've worked around it by setting the comment to NULL in the template and all other databases (in which case pg_dump doesn't output the comment line), but I was wondering if there was an easy way to keep the comments.

Tim

pgsql-general by date:

Previous
From: Kiriakos Georgiou
Date:
Subject: Re: Counting different strings (OK%, FB%) in same table, grouped by week number
Next
From:
Date:
Subject: Problem when reinstall postgresql value pg_config not update!!