Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRklN-0003Tg-Kh for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Jan 2017 19:10:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cRklN-0004AN-2p for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Jan 2017 19:10:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cRkkh-0002au-HP for pgsql-bugs@postgresql.org; Thu, 12 Jan 2017 19:09:35 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRkkd-0001Hh-Mw for pgsql-bugs@postgresql.org; Thu, 12 Jan 2017 19:09:34 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 03DBD5F79F; Thu, 12 Jan 2017 14:08:30 -0500 (EST) Date: Thu, 12 Jan 2017 14:08:30 -0500 From: Stephen Frost To: Tom Lane Cc: Moshe Jacobson , daniele.varrazzo@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #14456: pg_dump doesn't restore permissions on tables belonging to an extension Message-ID: <20170112190830.GP18360@tamriel.snowman.net> References: <20161208191642.1407.30751@wrigleys.postgresql.org> <20161208192933.GG23417@tamriel.snowman.net> <20170112183457.GJ18360@tamriel.snowman.net> <12559.1484247701@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Wndbo1Ahui+0IyF1" Content-Disposition: inline In-Reply-To: <12559.1484247701@sss.pgh.pa.us> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 14:05:57 up 187 days, 20:30, 39 users, load average: 0.11, 0.10, 0.09 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --Wndbo1Ahui+0IyF1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Moshe Jacobson writes: > > Scenario: >=20 > > 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. >=20 > 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. >=20 > 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 ref= er > > to a table that is not created as part of the installation process. >=20 > 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 extensio= n, > 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 --Wndbo1Ahui+0IyF1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYd9QuAAoJEO1sijiDR2RVW4gP/jUywlhWBcNNWe2xNHGwPe6n FX1J9xaqnwiNjgChpmHLpewsVZJLsQjtznWEQ9TMN1oaQ9WQQ3usGtEwvl5VWSNR gJUaO5yy2SLywCbZBbdUZX9qGXo3lrg0qKcHsT9AQnclzNenItVZq53OfPGhU/e5 SEkcvjFjn/VhAD9jmvcXG5nfEz6UzLNqm9LtCkjOjBCLqAqs9HTS9QHcKiKGEx2J FGN0dvcw4RMq6TrvjorD6aa9nMfTfBcDrTC02kwwR2pRghe1Pi7yCixa4uqSngVc D7Hx69zu47hr/2lLnpqbztKEqguxQssm1LKTfz/obDXn9g024/QJxL3KloeiT4bY zACNMd6nqPcASTv9AK4NgUKxGEMW/2gpuA5OUf1gz2XisNCqdxxcgsRoGIZYL6H2 A8chQeqoppVjvR9qeSJZBo8h1yLx6jfxltmx2eW19/uOOfz8I5Zp7pdOiM2z+iMb gW0aRW/fwvhaKEypHWhVpqtwLyDbG0932vCB0y8nzZd/rXQww4JHD2x7rEEhgVAk 1xs7/IGLlsFyJgD7qjncznX66LIC2M0QZXopa/SompLEw3Jz6DZ5TTNL7GNG8Fkd DaLtIIYiX+yCeYoU48LYwV95y8jxCCRtXklYE0kBzuDCOoz4/NmvBX5uWHPUrJbJ A+T3c2uEGz+QrO79+dPl =lDKl -----END PGP SIGNATURE----- --Wndbo1Ahui+0IyF1--