pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: zhoushulin1992@gmail.com <zhoushulin1992@gmail.com>
Cc: pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>
Subject: Re: 'pg_global' cannot be used as default_tablespace.
Date: Thu, 2 Nov 2023 09:43:18 -0400
Message-ID: <ZUOndqOz89dpD8T6@momjian.us> (raw)
In-Reply-To: <ZULgo051ezZMnWvM@momjian.us>
References: <160499688847.25495.8682880307938679648@wrigleys.postgresql.org>
	<ZULN_DUmssiXednO@momjian.us>
	<CAKFQuwY+s2BC2jZ4ZVwM7j6BXJ0zOCecOOfEM7_0szvVY_9deA@mail.gmail.com>
	<2878751.1698877957@sss.pgh.pa.us>
	<ZULWiAskl5qtYZN8@momjian.us>
	<2883160.1698880368@sss.pgh.pa.us>
	<ZULgo051ezZMnWvM@momjian.us>

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 <bruce@momjian.us> 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
> > -  <literal>pg_global</literal> tablespace is used for shared system catalogs. The
> > +  <literal>pg_global</literal> tablespace is used for shared system catalogs,
> > +  and cannot be used for user-defined tables. The
> >    <literal>pg_default</literal> tablespace is the default tablespace of the
> 
> I like the manage-ag.sgml change myself.

I found a cleaner improvement, attached.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.

Attachments:

  [text/x-diff] tablespace.diff (741B, ../ZUOndqOz89dpD8T6@momjian.us/2-tablespace.diff)
  download | inline 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);
   <para>
    Two tablespaces are automatically created when the database cluster
    is initialized.  The
-   <literal>pg_global</literal> tablespace is used for shared system catalogs. The
+   <literal>pg_global</literal> tablespace is used only for shared system catalogs. The
    <literal>pg_default</literal> tablespace is the default tablespace of the
    <literal>template1</literal> and <literal>template0</literal> databases (and, therefore,
    will be the default tablespace for other databases as well, unless

view thread (11+ messages)  latest in thread

Message-ID: <ZUOndqOz89dpD8T6@momjian.us>
Permalink:  ../ZUOndqOz89dpD8T6@momjian.us/
Also on:    postgresql.org/message-id/ZUOndqOz89dpD8T6@momjian.us

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, zhoushulin1992@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: 'pg_global' cannot be used as default_tablespace.
  In-Reply-To: <ZUOndqOz89dpD8T6@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox