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 1qyXyr-0096XH-I9 for pgsql-docs@arkaria.postgresql.org; Thu, 02 Nov 2023 13:43:29 +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 1qyXyq-00DIy1-2K for pgsql-docs@arkaria.postgresql.org; Thu, 02 Nov 2023 13:43:28 +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 1qyXyp-00DIxt-Kj for pgsql-docs@lists.postgresql.org; Thu, 02 Nov 2023 13:43:27 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qyXyh-003bvK-Pd for pgsql-docs@lists.postgresql.org; Thu, 02 Nov 2023 13:43:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=CGXEzlGYikr3XfBrrkk7+KBX+pUz8tJBzLkdFdpHz3M=; b=gc4Jt ADxbgu7oYUmT8v19y4WoqL5nNDrKIe7zyR7eWmJUfffOKnikGfyXMO9LG5zMuYJpgry7L0glNaJij 8rrHBvlVVOwtug93C+k11cp/5WwF4+ohhvuec5kmYnSJSvrgbx7xNmx+LAceB3rqkSwkU6v9no9vx Gu2G58vd/PjtKCVm9IMngKy9gqcp/nnwumaqiqKXrY0QmUtH6QnER4eE3hUlTVkIwvhkFR4fdKtMZ myhPjwsztq0hSeI+HzJa+WSuoed66uccnFUU08JHkqUSHg0p79H+h5YlAkiIzkJQXupULyJ9BoaNs ehXF/BIR+QtzSqyqWgzvKBzWLAP3w==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qyXyg-00C88y-0F; Thu, 02 Nov 2023 09:43:18 -0400 Date: Thu, 2 Nov 2023 09:43:18 -0400 From: Bruce Momjian To: Tom Lane Cc: "David G. Johnston" , "zhoushulin1992@gmail.com" , "pgsql-docs@lists.postgresql.org" Subject: Re: 'pg_global' cannot be used as default_tablespace. Message-ID: References: <160499688847.25495.8682880307938679648@wrigleys.postgresql.org> <2878751.1698877957@sss.pgh.pa.us> <2883160.1698880368@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="JVHD5tZtOaXsRQ0P" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --JVHD5tZtOaXsRQ0P Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Nov 1, 2023 at 07:34:59PM -0400, Bruce Momjian wrote: > On Wed, Nov 1, 2023 at 07:12:48PM -0400, Tom Lane wrote: > > 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 catalogs. The > > + pg_global tablespace is used for shared system catalogs, > > + and cannot be used for user-defined tables. The > > pg_default tablespace is the default tablespace of the > > I like the manage-ag.sgml change myself. I found a cleaner improvement, attached. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you. --JVHD5tZtOaXsRQ0P Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="tablespace.diff" diff --git a/doc/src/sgml/manage-ag.sgml b/doc/src/sgml/manage-ag.sgml index 192c500994..a02ef632c3 100644 --- a/doc/src/sgml/manage-ag.sgml +++ b/doc/src/sgml/manage-ag.sgml @@ -498,7 +498,7 @@ CREATE TABLE foo(i int); Two tablespaces are automatically created when the database cluster is initialized. The - pg_global tablespace is used for shared system catalogs. The + pg_global tablespace is used only for shared system catalogs. The pg_default tablespace is the default tablespace of the template1 and template0 databases (and, therefore, will be the default tablespace for other databases as well, unless --JVHD5tZtOaXsRQ0P--