Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Review wording on tablespaces w.r.t. partitioned tables
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 20 Mar 2024 14:28:14 +0000 (15:28 +0100)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 20 Mar 2024 14:28:14 +0000 (15:28 +0100)
Remove a redundant comment, and document pg_class.reltablespace properly
in catalogs.sgml.

After commits a36c84c3e4a987259588d0ab and others.

Backpatch to 12.

Discussion: https://postgr.es/m/202403191013.w2kr7wqlamqz@alvherre.pgsql

doc/src/sgml/catalogs.sgml
src/backend/commands/tablecmds.c

index 494473c177e5c58437d4f1be513930a599eab06a..118e325464e4e4035c6efc72e2a1ad61c23441a6 100644 (file)
@@ -1750,9 +1750,12 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
       <entry><type>oid</type></entry>
       <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.oid</literal></entry>
       <entry>
-       The tablespace in which this relation is stored.  If zero,
-       the database's default tablespace is implied.  (Not meaningful
-       if the relation has no on-disk file.)
+       The tablespace in which this relation is stored.
+       If zero, the database's default tablespace is implied.
+       Not meaningful if the relation has no on-disk file,
+       except for partitioned tables, where this is the tablespace
+       in which partitions will be created when one is not
+       specified in the creation command.
       </entry>
      </row>
 
index 4783b6c0631ec25373ad3719bdf37220cc35db3c..18d9d2f3f443dd738a9bec78c1799156d3675691 100644 (file)
@@ -695,10 +695,6 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
    }
    else if (stmt->partbound)
    {
-       /*
-        * For partitions, when no other tablespace is specified, we default
-        * the tablespace to the parent partitioned table's.
-        */
        Assert(list_length(inheritOids) == 1);
        tablespaceId = get_rel_tablespace(linitial_oid(inheritOids));
    }