Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDcSy-00070L-4s for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jun 2016 18:56:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bDcSx-0002ox-Kh for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jun 2016 18:56:35 +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 1bDcSK-00027b-Bs for pgsql-bugs@postgresql.org; Thu, 16 Jun 2016 18:55:56 +0000 Received: from smtprelay0026.b.hostedemail.com ([64.98.42.26] helo=smtprelay.b.hostedemail.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bDcSH-0000ka-3U for pgsql-bugs@postgresql.org; Thu, 16 Jun 2016 18:55:55 +0000 Received: from filter.hostedemail.com (10.5.19.248.rfc1918.com [10.5.19.248]) by smtprelay02.b.hostedemail.com (Postfix) with ESMTP id 32E1ED3992; Thu, 16 Jun 2016 18:55:52 +0000 (UTC) X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,alvherre@alvh.no-ip.org,:::,RULES_HIT:41:69:355:379:599:967:973:982:988:989:1260:1263:1277:1311:1312:1313:1314:1345:1359:1437:1515:1516:1518:1519:1534:1541:1593:1594:1595:1596:1711:1730:1747:1777:1792:2393:2525:2560:2563:2682:2685:2828:2859:2910:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3653:3865:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4605:4659:5007:6117:6119:6261:7903:9025:9121:10004:10400:10450:10455:10848:10946:11026:11232:11256:11257:11658:11914:12043:12296:12517:12519:12683:13069:13311:13357:13439:13894:13895:14110:14181:14721:14764:19904:19999:21080:30054:30070,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: offer18_32e93e099e347 X-Filterd-Recvd-Size: 2451 Received: from alvin.alvh.no-ip.org (unknown [216.155.90.98]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf09.b.hostedemail.com (Postfix) with ESMTPA; Thu, 16 Jun 2016 18:55:49 +0000 (UTC) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 55E7E4CC; Thu, 16 Jun 2016 14:55:47 -0400 (CLT) Date: Thu, 16 Jun 2016 14:55:47 -0400 From: Alvaro Herrera To: =?iso-8859-1?Q?Mart=EDn_Marqu=E9s?= Cc: pgsql-bugs@postgresql.org Subject: Re: pg_dump doesn't dump new objects created in schemas from extensions Message-ID: <20160616185547.GA72247@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <409fe594-f4cc-89f5-c0d2-0a921987a864@2ndquadrant.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -0.4 (/) 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 Martín Marqués wrote: > -bash-4.3$ pg_dump pruebas | psql -d pruebas_pgq > > Now, let's check what we have on this new DB: > > pruebas_pgq=# \dt pgq.test_pgq_dumpable > No se encontraron relaciones coincidentes. > pruebas_pgq=# \dt pgq.* > Listado de relaciones > Esquema | Nombre | Tipo | Dueño > ---------+----------------+-------+---------- > pgq | consumer | tabla | postgres > pgq | event_template | tabla | postgres > pgq | queue | tabla | postgres > pgq | retry_queue | tabla | postgres > pgq | subscription | tabla | postgres > pgq | tick | tabla | postgres > (6 filas) To make the problem worse, the pgq.create_queue() function also inserts rows in the pgq.queue table. The pgq.queue table is marked as a configuration table, so the rows that reference the pgq.event_1 etc tables are dumped, but not the tables themselves. This is pretty messy and I wonder why it hadn't been reported thus far. I would argue that those secondary tables should be created in a different schema, but then that schema would probably be created by the pgq extension script too and would not get dumped either. So we want the policy to change to "dump the table unless it has a dependency on an extension" (rather than "inherit dump flag from containing schema). I wonder what other things this change would break. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs