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 1hFfwM-0004Ld-1a for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Apr 2019 14:17:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hFfwK-0007x6-Tb for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Apr 2019 14:17:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hFfwK-0007wz-L6 for pgsql-hackers@lists.postgresql.org; Sun, 14 Apr 2019 14:17:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hFfwD-0005yh-9K for pgsql-hackers@lists.postgresql.org; Sun, 14 Apr 2019 14:17:00 +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 x3EEGibY011956; Sun, 14 Apr 2019 10:16:44 -0400 From: Tom Lane To: David Rowley cc: Alvaro Herrera , PostgreSQL Hackers , Andres Freund Subject: Re: pg_dump is broken for partition tablespaces In-reply-to: References: <20190412233637.GA5173@alvherre.pgsql> Comments: In-reply-to David Rowley message dated "Sun, 14 Apr 2019 23:21:15 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11954.1555251404.1@sss.pgh.pa.us> Date: Sun, 14 Apr 2019 10:16:44 -0400 Message-ID: <11955.1555251404@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > I'd say the fact that we populate reltablespace with 0 is a bug as > it's not going to do what they want after a dump/restore. Well, it's not really nice perhaps, but you cannot just put in some other concrete tablespace OID instead. What a zero there means is "use the database's default tablespace", and the point of it is that it still means that after the DB has been cloned with a different default tablespace. If we don't store 0 then we break "CREATE DATABASE ... TABLESPACE = foo". You could imagine using some special tablespace OID that has these semantics (*not* pg_default, but some new row in pg_tablespace). I'm not sure that that'd provide any functional improvement over using zero, but we could certainly entertain such a change if partitioned tables seem to need it. regards, tom lane