Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFnG6-0006iN-Uw for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Jun 2016 18:52:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bFnG6-0005vl-HV for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Jun 2016 18:52:18 +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 1bFnG5-0005vX-UH for pgsql-bugs@postgresql.org; Wed, 22 Jun 2016 18:52:18 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFnG2-0007I4-Ri for pgsql-bugs@postgresql.org; Wed, 22 Jun 2016 18:52:16 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 241875F79C; Wed, 22 Jun 2016 14:52:14 -0400 (EDT) Date: Wed, 22 Jun 2016 14:52:14 -0400 From: Stephen Frost To: Tom Lane Cc: =?iso-8859-1?Q?Mart=EDn_Marqu=E9s?= , Michael Paquier , Alvaro Herrera , PostgreSQL mailing lists Subject: Re: pg_dump doesn't dump new objects created in schemas from extensions Message-ID: <20160622185213.GP21416@tamriel.snowman.net> References: <409fe594-f4cc-89f5-c0d2-0a921987a864@2ndquadrant.com> <20160616185547.GA72247@alvherre.pgsql> <24a4d9cf-025d-d855-fe76-3af3f878174d@2ndquadrant.com> <29478.1466605967@sss.pgh.pa.us> <20160622145349.GK21416@tamriel.snowman.net> <30842.1466608326@sss.pgh.pa.us> <4193.1466616102@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IZZvyKtL+UeNpoYi" Content-Disposition: inline In-Reply-To: <4193.1466616102@sss.pgh.pa.us> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-77-generic (x86_64) X-Uptime: 14:43:15 up 120 days, 15:36, 41 users, load average: 0.19, 0.21, 0.19 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -3.3 (---) 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 --IZZvyKtL+UeNpoYi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Tom Lane (tgl@sss.pgh.pa.us) wrote: > =3D?UTF-8?Q?Mart=3Dc3=3Dadn_Marqu=3Dc3=3Da9s?=3D = writes: > > On HEAD I actually see that we *are* setting dump_contains as well: >=20 > > if (fout->remoteVersion < 90600) > > dobj->dump =3D DUMP_COMPONENT_NONE; > > else > > dobj->dump =3D ext->dobj.dump_contains & (DUMP_COMPONENT_ACL | > > DUMP_COMPONENT_SECLABEL | DUMP_COMPONENT_POLICY); >=20 > Uh, what? >=20 > (BTW, Stephen, what's the point of the version check here? The 'else' > code seems like it would work just fine in all branches.) We only have the pg_init_privs information in 9.6 and above. If we dumped out extension ACLs, etc, for prior versions, we'd end up dumping all of them (including ones which were set initially as part of the extension itself). That didn't seem quite right. Generally speaking, the checks are there to keep dumps of prior-to-9.6 versions of PG similar to pre-9.6 pg_dump. > >> So maybe just moving the checkExtensionMembership call to after the ot= her > >> stuff would be enough in HEAD? >=20 > > Looking into older versions as well I can't see how placing > > checkExtensionMembership at the end of selectDumpableNamespace would > > help. (like-wise for other selectDumpable's) >=20 > The fix in HEAD will necessarily look quite a bit different from > the back branches, I fear. But the idea I had in mind there was that > we'd calculate a namespace's dump and dump_contains flags as if it > were not an extension member, and then allow checkExtensionMembership > to overwrite the dump flags if it is a member. Since > checkExtensionMembership doesn't touch the dump_contains flags, that > would leave all the flags in the desired state. That sounds like a pretty reasonable idea. The devil is in the details with pg_dump though, we'll definitely want a bunch of regression tests around this to ensure we have the correct behavior, and notice if we break it (as happened, apparently, in the back-branches already). Thanks! Stephen --IZZvyKtL+UeNpoYi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJXat5dAAoJEO1sijiDR2RVZEUQAKmxrNxjmNiVeUCTdxd3TAf0 XTLVR69jNybvvMC6/Hkg3mPVTstZNAdhPvF017dcVsmbakdTdEbWR1tSnqlKnyIe TXBOkqJsL71C4Xjv2liPSE2/+152M69FFKEZFuW2e+W2p4FOVHUBDZc/oJDe3/JX 5dDWWrlYXW/xj2VDnocbCQVtaT9c1HimiJGNs3A/jSHtoBqzvb2+ku+YlwF/C3oS eNAgyt66/QtwZGEgHzTrLvkkuapFeY9qbcpMESgchN3mqEOPMRTvRhnsOEH/TSUF MAj79ebatn70x0X7a1P48ZkTJacYWLmWZbonXQ8xSgaJyQag34F9v3AjbYi0znWD aqQn54TIo241MQMWZtnfCLK4CSozz7+ekveRt6JBHVIvEAMyG5ZFWfqpgxjGX/hp R0TVLS9PE801TPZc9ffmmGOSbUgRVl/x8KTxv2J+xd4m32veLksbcuU3Fqravna0 p6sv+WFbB9dYi2BVIQXVPjPEAYhj6tSlfH0bhQEACVNqQQ71o9WOCLsmQ7Ch5E2L pkSDZOZeoqVpIqJZhgRrv2DVlF0Pgjpu097h2eqfNMPafkB2gnvFqxShJgwskNB3 uLLNaAeLOm7U44BGNtZpdfZX3JHvgBbI0pg7rUX0rSXv976lioIuJ4ZwMZiP0Y9S bTtctIjtPy/9BNDObnaN =2y7U -----END PGP SIGNATURE----- --IZZvyKtL+UeNpoYi--