From: Tom Lane <tgl@sss.pgh.pa.us>
To: Moshe Jacobson <moshe@neadwerx.com>
Cc: Stephen Frost <sfrost@snowman.net>
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:01:41 -0500
Message-ID: <12559.1484247701@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJ4CxLk8iAsLVgmv2NAWNoKD3cA+pqJ0UmB9=135DsJzcfEXOg@mail.gmail.com>
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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.
> 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 ...
> 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.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: tgl@sss.pgh.pa.us, moshe@neadwerx.com, sfrost@snowman.net, daniele.varrazzo@gmail.com
Subject: Re: BUG #14456: pg_dump doesn't restore permissions on tables belonging to an extension
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>
* 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