Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRkd9-00038w-Cg for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Jan 2017 19:01:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cRkd8-00063Z-OA for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Jan 2017 19:01:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cRkd8-00063D-0p for pgsql-bugs@postgresql.org; Thu, 12 Jan 2017 19:01:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cRkd5-0001i3-0o for pgsql-bugs@postgresql.org; Thu, 12 Jan 2017 19:01:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v0CJ1fTl012560; Thu, 12 Jan 2017 14:01:41 -0500 From: Tom Lane To: Moshe Jacobson cc: Stephen Frost , daniele.varrazzo@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #14456: pg_dump doesn't restore permissions on tables belonging to an extension In-reply-to: References: <20161208191642.1407.30751@wrigleys.postgresql.org> <20161208192933.GG23417@tamriel.snowman.net> <20170112183457.GJ18360@tamriel.snowman.net> Comments: In-reply-to Moshe Jacobson message dated "Thu, 12 Jan 2017 18:49:14 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12558.1484247701.1@sss.pgh.pa.us> Date: Thu, 12 Jan 2017 14:01:41 -0500 Message-ID: <12559.1484247701@sss.pgh.pa.us> 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 Moshe Jacobson 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