pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Moshe Jacobson <moshe@neadwerx.com>
Cc: daniele.varrazzo@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14456: pg_dump doesn't restore permissions on tables belonging to an extension
Date: Thu, 12 Jan 2017 14:08:30 -0500
Message-ID: <20170112190830.GP18360@tamriel.snowman.net> (raw)
In-Reply-To: <12559.1484247701@sss.pgh.pa.us>
References: <20161208191642.1407.30751@wrigleys.postgresql.org>
	<20161208192933.GG23417@tamriel.snowman.net>
	<CAJ4CxLmGST-UkYzhrS-QbXLoXeYnZPPO7m7b9U=2RRr-cTArHQ@mail.gmail.com>
	<20170112183457.GJ18360@tamriel.snowman.net>
	<CAJ4CxLk8iAsLVgmv2NAWNoKD3cA+pqJ0UmB9=135DsJzcfEXOg@mail.gmail.com>
	<12559.1484247701@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Greetings,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Moshe Jacobson <moshe@neadwerx.com> writes:
> > Scenario:
> 
> >    1. Extension is installed into its own schema. Installation is now
> >    complete.
> >    2. Extension creates a new table in its schema
> >    3. Extension changes ACLs on the table.
> 
> Extensions are not actors, so claiming that "the extension" did something
> is at best pretty fuzzy thinking.

Agreed.

> >    4. After changing ACLs, the table is added to the extension (ALTER
> >    EXTENSION)
> >    5. A pg_dump of this database will now include ACL commands for the
> >    table.
> 
> Hmm.  There's an argument to be made that ALTER EXTENSION ADD should
> absorb whatever the object's current ACLs are into the pg_init_privs
> entries for the extension.  (I don't think it does that now, though
> I might be wrong.)  However ...

I've not gone and looked yet, but I doubt that it does.  I think I can
agree with the argument that it really should add those ACLs to
pg_init_privs.  Of course, any furhter manipulation of the ACLs from
that point will cause those ACLs to be included in the pg_dump.

I'll take a look at ALTER EXTENSION ADD and pg_init_privs.

> >    6. A pg_restore of this file will give warnings because the ACLs refer
> >    to a table that is not created as part of the installation process.
> 
> I think this scenario is simply pilot error, or at least gross abuse of
> the extension system.  If you dump and reload a DB containing an extension,
> the extension definition that's fetched by CREATE EXTENSION is expected
> to define (at least) all the objects that belonged to the extension in the
> old DB.  You can't just randomly ALTER EXTENSION and not update the
> extension definition script to match.

Agreed.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (18+ messages)  latest in thread

Message-ID: <20170112190830.GP18360@tamriel.snowman.net>
Permalink:  ../20170112190830.GP18360@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20170112190830.GP18360@tamriel.snowman.net

 · 

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: sfrost@snowman.net, tgl@sss.pgh.pa.us, moshe@neadwerx.com, daniele.varrazzo@gmail.com
  Subject: Re: BUG #14456: pg_dump doesn't restore permissions on tables belonging to an extension
  In-Reply-To: <20170112190830.GP18360@tamriel.snowman.net>
  References: <20161208191642.1407.30751@wrigleys.postgresql.org> <20161208192933.GG23417@tamriel.snowman.net> <CAJ4CxLmGST-UkYzhrS-QbXLoXeYnZPPO7m7b9U=2RRr-cTArHQ@mail.gmail.com> <20170112183457.GJ18360@tamriel.snowman.net> <CAJ4CxLk8iAsLVgmv2NAWNoKD3cA+pqJ0UmB9=135DsJzcfEXOg@mail.gmail.com> <12559.1484247701@sss.pgh.pa.us> <20170112190830.GP18360@tamriel.snowman.net>

* 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