Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8nla-0004LH-Ae for pgsql-hackers@arkaria.postgresql.org; Thu, 11 May 2017 13:04:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d8nlZ-0001OZ-Cf for pgsql-hackers@arkaria.postgresql.org; Thu, 11 May 2017 13:04:25 +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 1d8nk3-0006fG-6k for pgsql-hackers@postgresql.org; Thu, 11 May 2017 13:02:51 +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 1d8njw-0008Hp-CH for pgsql-hackers@postgresql.org; Thu, 11 May 2017 13:02:50 +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 v4BD2gPt031401; Thu, 11 May 2017 09:02:42 -0400 From: Tom Lane To: Jeevan Ladhe cc: Ashutosh Bapat , Robert Haas , amul sul , PostgreSQL-development Subject: Re: Bug in pg_dump --table and --exclude-table for declarative partition table handling. In-reply-to: References: <14125.1494452121@sss.pgh.pa.us> Comments: In-reply-to Jeevan Ladhe message dated "Thu, 11 May 2017 18:20:04 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31398.1494507762.1@sss.pgh.pa.us> Date: Thu, 11 May 2017 09:02:42 -0400 Message-ID: <31399.1494507762@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Jeevan Ladhe writes: > On Thu, May 11, 2017 at 4:47 PM, Ashutosh Bapat < >> We add PARTITION OF clause for a table which is partition, so if the >> parent is not present while restoring, the restore is going to fail. > +1 > But, similarly for inheritance if we dump a child table, it's dump is > broken as > of today. When we dump a child table we append "inherits(parenttab)" clause > at > the end of the DDL. Later when we try to restore this table on a database > not > having the parenttab, the restore fails. > So, I consider this as a bug. It sounds exactly what I'd expect. In particular, given that pg_dump has worked that way for inherited tables from the beginning, it's hard to see any must-fix bugs here. You could argue that it would be better for pg_dump to emit something like CREATE TABLE c (...); ALTER TABLE c INHERIT p; so that if p isn't around, at least c gets created. And I think it *would* be better, probably. But if that isn't a new feature then I don't know what is. And partitioning really ought to track the behavior of inheritance here. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers