pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: chris@chrullrich.net
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8695: Reloading dump fails at COMMENT ON EXTENSION plpgsql
Date: Wed, 9 Apr 2014 21:52:18 -0400
Message-ID: <20140410015218.GP8685@momjian.us> (raw)
In-Reply-To: <20140331170009.GA18559@momjian.us>
References: <E1VuYH7-0008Rz-SV@wrigleys.postgresql.org>
	<20140331170009.GA18559@momjian.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Mon, Mar 31, 2014 at 01:00:09PM -0400, Bruce Momjian wrote:
> 	CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
> 	CREATE EXTENSION
> -->	COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
> -->	ERROR:  must be owner of extension plpgsql
> 	REVOKE ALL ON SCHEMA public FROM PUBLIC;
> 	WARNING:  no privileges could be revoked for "public"
> 	REVOKE
> 	REVOKE ALL ON SCHEMA public FROM postgres;
> 	WARNING:  no privileges could be revoked for "public"
> 	REVOKE
> 	GRANT ALL ON SCHEMA public TO postgres;
> 	WARNING:  no privileges were granted for "public"
> 	GRANT
> 	GRANT ALL ON SCHEMA public TO PUBLIC;
> 	WARNING:  no privileges were granted for "public"
> 	GRANT
> 
> This would certainly cause a restore to abort for a non-super-user if
> psql used --set ON_ERROR_STOP=on.  Any easy way to fix this?  I am not
> super-excited about the suggested fixes listed above.

In looking at this further, I wonder why we don't filter out pg_catalog
extensions when we dump them;  right now we use:

    appendPQExpBufferStr(query, "SELECT x.tableoid, x.oid, "
                         "x.extname, n.nspname, x.extrelocatable, x.extversion, x.extconfig, x.extcondition "
                         "FROM pg_extension x "
                         "JOIN pg_namespace n ON n.oid = x.extnamespace");

I see a filter on pg_catalog for pg_proc.  Is there a reason there isn't
one for pg_extension?

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (8+ messages)  latest in thread

Message-ID: <20140410015218.GP8685@momjian.us>
Permalink:  ../20140410015218.GP8685@momjian.us/
Also on:    postgresql.org/message-id/20140410015218.GP8685@momjian.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: bruce@momjian.us, chris@chrullrich.net
  Subject: Re: BUG #8695: Reloading dump fails at COMMENT ON EXTENSION plpgsql
  In-Reply-To: <20140410015218.GP8685@momjian.us>
  References: <E1VuYH7-0008Rz-SV@wrigleys.postgresql.org> <20140331170009.GA18559@momjian.us> <20140410015218.GP8685@momjian.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