Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXUw4-0000SO-CQ for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Apr 2021 20:19:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lXUw3-0004xZ-B2 for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Apr 2021 20:19:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXUw2-0004xQ-Id for pgsql-hackers@lists.postgresql.org; Fri, 16 Apr 2021 20:19:27 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXUvz-0007jz-Hz for pgsql-hackers@postgresql.org; Fri, 16 Apr 2021 20:19:25 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 482F55C0199; Fri, 16 Apr 2021 16:19:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 16 Apr 2021 16:19:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=l/K4i5qKIZ2HZ7ODVBPHRzHWJbHs3O8014gFWIArZbg=; b=Si2iMPYz rcXGXAAPt0JhuZ+F11T2H1wMZB+SHM4cnykbHwJM7k1ITrA4u5cIjUgQP00deDyR 6zUd3YAIZW4N6dtM5CWQeYcVEMQ9FImNlLeyNg1PcCd+Kl6ptR/kiwsHhgSIhWq+ TYl5D4ezsvQsUq3N8B2rFOxJZTFnG4JzMvHVspcVaxYiG4PwZHkKpANx47W0zsDG Fd6G48Xg4CG808fxzALR3SmnTCqzza5S5wgPtSAa5Ph+pIkr4ozxhzn0z0jLEJOv QzjF+NkVMqsDyyp8c1L1UiUSiQeRmfykCIHzZL3KlYfEK2hTX0fpCBZLQcMUXyLj /vOBM0bIdCHU2A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudelhedgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpeeufffhjeeiueeuffegvddukeegledtveeivdeiueef ieeivefgteehueefteehvdenucfkphepudeltddrleehrdduledrleehnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegr lhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 79359240065; Fri, 16 Apr 2021 16:19:21 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9DD0A2A654C; Fri, 16 Apr 2021 16:19:18 -0400 (-04) Date: Fri, 16 Apr 2021 16:19:18 -0400 From: Alvaro Herrera To: Justin Pryzby Cc: pgsql-hackers Subject: Re: default_tablespace doc and partitioned rels Message-ID: <20210416201918.GA4771@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210416143135.GI3315@telsasoft.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Apr-16, Justin Pryzby wrote: > +++ b/doc/src/sgml/config.sgml > @@ -7356,7 +7356,8 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv; > > This variable specifies the default tablespace in which to create > objects (tables and indexes) when a CREATE command does > - not explicitly specify a tablespace. > + not explicitly specify a tablespace. It also determines the tablespace > + that a partitioned relation will direct future partitions to. > > > default_tablespace is a global GUC, so if a partitioned relation "directs" > partitions anywhere, it's not to the fallback value of the GUC, but to its > reltablespace, as this patch wrote in doc/src/sgml/ref/create_table.sgml: Yes, but also the partitioned table's reltablespace is going to be set to default_tablespace, if no tablespace is explicitly specified in the partitioned table creation. A partitioned table is not created anywhere itself; the only thing it can do, is direct where are future partitions created. I don't think it's 100% obvious that default_tablespace will become the partitioned table's tablespace, which is why I added that phrase. I understand that the language might be unclear, but I don't think either of your suggestions make this any clearer. Removing it just hides the behavior, and this one: > + ... It also determines the tablespace where new partitions are created, > + if the parent, partitioned relation doesn't have a tablespace set. just documents that default_tablespace will be in effect at partition CREATE time, but it fails to remind the user that the partitioned table will acquire default_tablespace as its own tablespace. Maybe we can reword it in some other way. "If this parameter is set when a partitioned table is created, it will become the default tablespace for future partitions too, even if default_tablespace itself is reset later" ...?? -- Álvaro Herrera 39°49'30"S 73°17'W "En las profundidades de nuestro inconsciente hay una obsesiva necesidad de un universo lógico y coherente. Pero el universo real se halla siempre un paso más allá de la lógica" (Irulan)