pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
minor tweak to catalogs.sgml pg_class.reltablespace
3+ messages / 2 participants
[nested] [flat]

* minor tweak to catalogs.sgml pg_class.reltablespace
@ 2024-03-19 10:34 Alvaro Herrera <alvherre@alvh.no-ip.org>
  2024-03-19 13:34 ` Re: minor tweak to catalogs.sgml pg_class.reltablespace Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Alvaro Herrera @ 2024-03-19 10:34 UTC (permalink / raw)
  To: Pg Hackers <pgsql-hackers@lists.postgresql.org>

While reviewing the patch for SET ACCESS METHOD[1] I noticed that
pg_class.relam is not documented fully for partitioned tables, so I
proposed the attached.  Also, I remove a comment that merely repeats
what was already said a few lines above.

This is intended for backpatch to 12.

[1] https://postgr.es/m/202403191013.w2kr7wqlamqz@alvherre.pgsql

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/

Attachments:

0001-Review-for-wording-on-tablespaces-on-partitioned-tab.patch (text/x-diff, 2.1K) download From fe4d53f33c688ab3ff132964bf42ba5fc8cdaa6e Mon Sep 17 00:00:00 2001 From: Alvaro Herrera <alvherre@alvh.no-ip.org> Date: Tue, 19 Mar 2024 09:49:46 +0100 Subject: [PATCH] Review for wording on tablespaces on partitioned tables Remove a redundant comment, and document pg_class.relam in catalogs.sgml. After commits a36c84c3e4a9, 87259588d0ab and others. Discussion: https://postgr.es/m/202403191013.w2kr7wqlamqz@alvherre.pgsql --- doc/src/sgml/catalogs.sgml | 8 +++++--- src/backend/commands/tablecmds.c | 4 ---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 2f091ad09d..183669272b 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -2011,9 +2011,11 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l (references <link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.<structfield>oid</structfield>) </para> <para> - 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; for partitioned + tables, the tablespace in which partitions are created + when one is not specified in the creation command. + If zero, the database's default tablespace is implied. + (Not meaningful if the relation has no on-disk file.) </para></entry> </row> diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 3ed0618b4e..6c0c899210 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -807,10 +807,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)); } -- 2.39.2
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: minor tweak to catalogs.sgml pg_class.reltablespace
  2024-03-19 10:34 minor tweak to catalogs.sgml pg_class.reltablespace Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2024-03-19 13:34 ` Tom Lane <tgl@sss.pgh.pa.us>
  2024-03-20 14:31   ` Re: minor tweak to catalogs.sgml pg_class.reltablespace Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2024-03-19 13:34 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> While reviewing the patch for SET ACCESS METHOD[1] I noticed that
> pg_class.relam is not documented fully for partitioned tables, so I
> proposed the attached.

The bit about "(Not meaningful if the relation has no on-disk file.)"
is not correct, and now it's adjacent to text that contradicts it.
Maybe more like

       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.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: minor tweak to catalogs.sgml pg_class.reltablespace
  2024-03-19 10:34 minor tweak to catalogs.sgml pg_class.reltablespace Alvaro Herrera <alvherre@alvh.no-ip.org>
  2024-03-19 13:34 ` Re: minor tweak to catalogs.sgml pg_class.reltablespace Tom Lane <tgl@sss.pgh.pa.us>
@ 2024-03-20 14:31   ` Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Alvaro Herrera @ 2024-03-20 14:31 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>

On 2024-Mar-19, Tom Lane wrote:

> The bit about "(Not meaningful if the relation has no on-disk file.)"
> is not correct, and now it's adjacent to text that contradicts it.
> Maybe more like
> 
>        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.

I like that wording, thanks, pushed like that.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Right now the sectors on the hard disk run clockwise, but I heard a rumor that
you can squeeze 0.2% more throughput by running them counterclockwise.
It's worth the effort. Recommended."  (Gerry Pourwelle)





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-03-20 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19 10:34 minor tweak to catalogs.sgml pg_class.reltablespace Alvaro Herrera <alvherre@alvh.no-ip.org>
2024-03-19 13:34 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-03-20 14:31   ` Alvaro Herrera <alvherre@alvh.no-ip.org>

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