Comment on extension issues with pg_dump after upgrading to 9.1.2

From: Timothy Garnett <tgarnett(at)panjiva(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Comment on extension issues with pg_dump after upgrading to 9.1.2
Date: 2012-02-23 00:23:23
Message-ID: CAPcyiQ0fas+4QsgDbXSFK5LsJTN3ORB=Ua3KyND5U-Ore_BTLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kiriakos Georgiou 2012-02-23 00:51:08 Re: Counting different strings (OK%, FB%) in same table, grouped by week number
Previous Message Jens Wilke 2012-02-22 22:19:59 Re: Why warm-standby doesn't work using file-based log shipping method?