Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFjDj-0002Ep-8x for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Jun 2016 14:33:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bFjDh-0007eZ-SS for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Jun 2016 14:33:33 +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 1bFjD3-0006BV-Mw for pgsql-bugs@postgresql.org; Wed, 22 Jun 2016 14:32:53 +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 1bFjD0-0001L5-HN for pgsql-bugs@postgresql.org; Wed, 22 Jun 2016 14:32:51 +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 u5MEWlCn029479; Wed, 22 Jun 2016 10:32:47 -0400 From: Tom Lane To: =?UTF-8?Q?Mart=c3=adn_Marqu=c3=a9s?= cc: Stephen Frost , Michael Paquier , Alvaro Herrera , PostgreSQL mailing lists Subject: Re: pg_dump doesn't dump new objects created in schemas from extensions In-reply-to: <24a4d9cf-025d-d855-fe76-3af3f878174d@2ndquadrant.com> References: <409fe594-f4cc-89f5-c0d2-0a921987a864@2ndquadrant.com> <20160616185547.GA72247@alvherre.pgsql> <24a4d9cf-025d-d855-fe76-3af3f878174d@2ndquadrant.com> Comments: In-reply-to =?UTF-8?Q?Mart=c3=adn_Marqu=c3=a9s?= message dated "Fri, 17 Jun 2016 14:21:01 -0300" Date: Wed, 22 Jun 2016 10:32:47 -0400 Message-ID: <29478.1466605967@sss.pgh.pa.us> 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 =?UTF-8?Q?Mart=c3=adn_Marqu=c3=a9s?= writes: > This is a new version of your patch that checks for schema inclusion or > exclusion. > If there are no complains, I could apply similar changes on other > objects for a more complete patch. > Thoughts, objections? This patch seems to me to be entirely the wrong approach, as what it will result in is an enormous amount of code duplication. There's nothing fundamentally wrong with looking at the parent namespace to decide whether to dump or not. The difficulty is that we need to draw a distinction *at the namespace level* between "dump this namespace" and "dump objects within this namespace". The correct behavior for a namespace owned by an extension is to do the latter (for objects not belonging to any extension) but not the former. So instead of just one "dump" flag, we need two such flags for namespaces. The various selectDumpableFoo routines need one-line adjustments as to which flag they look at in the parent namespace. They do *not* need copy-and-paste of their entire current contents. In HEAD, this should be a pretty straightforward change since Stephen Frost has already created infrastructure that allows distinguishing which "components" of an object to dump. There doesn't seem to be a bit that corresponds to "objects within this schema", but that shouldn't be hard to add. The DUMP_COMPONENT infrastructure doesn't exist in older branches so I think you'd just have to invent an additional bool field in NamespaceInfo structs to say whether to dump contained objects. A slightly different approach is to ignore the DumpComponents stuff and just add a bool field in NamespaceInfo for all branches. Perhaps this would even be the right thing, as I may be misunderstanding what Stephen intends the DumpComponents bits to be used for. Would be interesting to hear Stephen's take on this. 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