Review wording on tablespaces w.r.t. partitioned tables
authorAlvaro Herrera
Wed, 20 Mar 2024 14:28:14 +0000 (15:28 +0100)
committerAlvaro Herrera
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[email protected]

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

index 43cccb43d62094b7e94f044a6f0cf4f8d5e5e5be..4945d4bc6e8e584afa051cde3a11e676b41b8035 100644 (file)
@@ -2010,9 +2010,12 @@ SCRAM-SHA-256$<iteration count>:&l
        (references pg_tablespace.oid)
       
       
-       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.
       
      
 
index 9cabdfe668a8540c56cd2eba8e5b03f295f8bef5..6f854c187ade43e0a9815a318fccbe0596b8b0de 100644 (file)
@@ -785,10 +785,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));
    }