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: Martín Marqués <martin@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: pg_dump doesn't dump new objects created in schemas from extensions
Date: Wed, 22 Jun 2016 14:52:14 -0400
Message-ID: <20160622185213.GP21416@tamriel.snowman.net> (raw)
In-Reply-To: <4193.1466616102@sss.pgh.pa.us>
References: <409fe594-f4cc-89f5-c0d2-0a921987a864@2ndquadrant.com>
	<20160616185547.GA72247@alvherre.pgsql>
	<CAPdiE1wgOVvWq3q9W3wAKrin1LnQevwQQet+qGoe_sMnfRbbjA@mail.gmail.com>
	<CAB7nPqQJzP1dLCwa9uj-keJafmLd3KXDQbRmsSYZbkNz3nu_uA@mail.gmail.com>
	<24a4d9cf-025d-d855-fe76-3af3f878174d@2ndquadrant.com>
	<29478.1466605967@sss.pgh.pa.us>
	<20160622145349.GK21416@tamriel.snowman.net>
	<30842.1466608326@sss.pgh.pa.us>
	<d569199f-a76f-3859-5332-f861e0ac26eb@2ndquadrant.com>
	<4193.1466616102@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> =?UTF-8?Q?Mart=c3=adn_Marqu=c3=a9s?= <martin@2ndquadrant.com> writes:
> > On HEAD I actually see that we *are* setting dump_contains as well:
> 
> > if (fout->remoteVersion < 90600)
> > 	dobj->dump = DUMP_COMPONENT_NONE;
> > else
> > 	dobj->dump = ext->dobj.dump_contains & (DUMP_COMPONENT_ACL |
> > 		DUMP_COMPONENT_SECLABEL | DUMP_COMPONENT_POLICY);
> 
> Uh, what?
> 
> (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 other
> >> stuff would be enough in HEAD?
> 
> > 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)
> 
> 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

Attachments:

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

view thread (20+ messages)  latest in thread

Message-ID: <20160622185213.GP21416@tamriel.snowman.net>
Permalink:  ../20160622185213.GP21416@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20160622185213.GP21416@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, martin@2ndquadrant.com, michael.paquier@gmail.com, alvherre@2ndquadrant.com
  Subject: Re: pg_dump doesn't dump new objects created in schemas from extensions
  In-Reply-To: <20160622185213.GP21416@tamriel.snowman.net>
  References: <409fe594-f4cc-89f5-c0d2-0a921987a864@2ndquadrant.com> <20160616185547.GA72247@alvherre.pgsql> <CAPdiE1wgOVvWq3q9W3wAKrin1LnQevwQQet+qGoe_sMnfRbbjA@mail.gmail.com> <CAB7nPqQJzP1dLCwa9uj-keJafmLd3KXDQbRmsSYZbkNz3nu_uA@mail.gmail.com> <24a4d9cf-025d-d855-fe76-3af3f878174d@2ndquadrant.com> <29478.1466605967@sss.pgh.pa.us> <20160622145349.GK21416@tamriel.snowman.net> <30842.1466608326@sss.pgh.pa.us> <d569199f-a76f-3859-5332-f861e0ac26eb@2ndquadrant.com> <4193.1466616102@sss.pgh.pa.us> <20160622185213.GP21416@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