Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qyKOq-007evx-H9 for pgsql-docs@arkaria.postgresql.org; Wed, 01 Nov 2023 23:13:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qyKOo-009WAS-88 for pgsql-docs@arkaria.postgresql.org; Wed, 01 Nov 2023 23:13:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qyKOo-009WAK-0P for pgsql-docs@lists.postgresql.org; Wed, 01 Nov 2023 23:13:22 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qyKOh-003Vx0-BZ for pgsql-docs@lists.postgresql.org; Wed, 01 Nov 2023 23:13:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3A1NCmsv2883161; Wed, 1 Nov 2023 19:12:48 -0400 From: Tom Lane To: Bruce Momjian cc: "David G. Johnston" , "zhoushulin1992@gmail.com" , "pgsql-docs@lists.postgresql.org" Subject: Re: 'pg_global' cannot be used as default_tablespace. In-reply-to: References: <160499688847.25495.8682880307938679648@wrigleys.postgresql.org> <2878751.1698877957@sss.pgh.pa.us> Comments: In-reply-to Bruce Momjian message dated "Wed, 01 Nov 2023 18:51:52 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2883159.1698880368.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 01 Nov 2023 19:12:48 -0400 Message-ID: <2883160.1698880368@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bruce Momjian writes: > On Wed, Nov 1, 2023 at 06:32:37PM -0400, Tom Lane wrote: >> But it *is* permissible, unless we add code to reject it during >> SET as Bruce mentioned. Which seems fairly pointless to me. It's not >> like there is anything unclear about the CREATE TABLE error message. > Yeah, from the report I thought something bad happened if you tried to > use it and that is why we had to document it. By documenting it we are > just giving the user advice before they get the error. I wrote up this > minimal patch which might have the right level of detail to avoid > errors, if people think this is useful. I think this will lead to just as much confusion, because people will read it and expect that SET will fail. If we need to document any more than we have now, we should point out in the CREATE TABLE man page that you can't create a table in the pg_global tablespace. That will cover both this case and the case of trying to select pg_global explicitly in the CREATE. Another idea could be to adjust this bit in manage-ag.sgml: Two tablespaces are automatically created when the database cluster is initialized. The - pg_global tablespace is used for shared system catal= ogs. The + pg_global tablespace is used for shared system catal= ogs, + and cannot be used for user-defined tables. The pg_default tablespace is the default tablespace of t= he regards, tom lane