Obsolete comments in ResultRelInfo struct

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Obsolete comments in ResultRelInfo struct
Date: 2025-08-11 11:24:48
Message-ID: CAPmGK14NF5CcdCmTZpxrvpvBiT0y4EqKikW1r_wAu1CEHeOmUA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While working on commit 62a1211d3, I noticed $SUBJECT:

/*
* Information needed by tuple routing target relations
*
* RootResultRelInfo gives the target relation mentioned in the query, if
* it's a partitioned table. It is not set if the target relation
* mentioned in the query is an inherited table, nor when tuple routing is
* not needed.
*
* PartitionTupleSlot is non-NULL if RootToChild conversion is needed and
* the relation is a partition.
*/
struct ResultRelInfo *ri_RootResultRelInfo;
TupleTableSlot *ri_PartitionTupleSlot;

I think the comment about ri_RootResultRelInfo is correct for pre-14
versions, but not for later versions because it is set also when the
target relation is an inherited table (see ExecInitModifyTable()), in
which case it is used for transition capture, not for tuple routing.
So I would like to propose to update that comment like this:

/*
* Other information needed by child result relations
*
* RootResultRelInfo gives the target relation mentioned in the query.
* Used as the root for tuple routing and/or transition capture.
*
* PartitionTupleSlot is non-NULL if the relation is a partition to route
* tuples into and RootToChild conversion is needed.
*/

I slightly modified the top and bottom comments as well. (In the top
comment, I added "Other" because we have the definitions of members
such as ri_ChildToRootMap and ri_RootToChildMap above.)

Comments welcome!

Best regards,
Etsuro Fujita

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dagfinn Ilmari Mannsåker 2025-08-11 11:40:34 Re: Improve tab completion for various SET/RESET forms
Previous Message David Geier 2025-08-11 11:13:19 Understanding ExecShutdownNode()