Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIdiK-0005Dj-06 for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 18:30:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIdiI-0008As-FP for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 18:30:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIdiI-0008Af-3X for pgsql-hackers@lists.postgresql.org; Mon, 22 Apr 2019 18:30:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIdiF-0005pT-RN for pgsql-hackers@lists.postgresql.org; Mon, 22 Apr 2019 18:30:44 +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 x3MIUaV9021098; Mon, 22 Apr 2019 14:30:36 -0400 From: Tom Lane To: Andres Freund cc: Alvaro Herrera , Robert Haas , David Rowley , PostgreSQL Hackers Subject: Re: pg_dump is broken for partition tablespaces In-reply-to: <20190422182050.a73zl4wkfwx2ujou@alap3.anarazel.de> References: <20190422181628.GA29329@alvherre.pgsql> <20190422182050.a73zl4wkfwx2ujou@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 22 Apr 2019 11:20:50 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21096.1555957836.1@sss.pgh.pa.us> Date: Mon, 22 Apr 2019 14:30:36 -0400 Message-ID: <21097.1555957836@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2019-04-22 14:16:28 -0400, Alvaro Herrera wrote: >> I think we can get out of this whole class of problems by forbidding the >> TABLESPACE clause for partitioned rels from mentioning the database >> tablespace -- that is, users either mention some *other* tablespace, or >> partitions follow default_tablespace like everybody else. AFAICS with >> that restriction this whole problem does not arise, and the patch may >> become simpler. I'll give it a spin. > Why is the obvious answer is to not just remove the whole tablespace > inheritance behaviour? It's obviously ambiguous and hard to get right. > I still don't see any usecase that even comes close to making the > inheritance useful enough to justify the amount of work (code, tests, > bugfixes) and docs that are required. Yeah, that's where I'm at as well. Alvaro's proposal could be made to work perhaps, but I think it would still end up with some odd corner-case behaviors. One example is that "TABLESPACE X" would be allowed if the database's default tablespace is Y, but if you try to dump and restore into a database whose default is X, it'd be rejected (?). The results after ALTER DATABASE ... SET TABLESPACE X are unclear too. regards, tom lane