Obsolete comments in ResultRelInfo struct - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Obsolete comments in ResultRelInfo struct
Date
Msg-id CAPmGK14NF5CcdCmTZpxrvpvBiT0y4EqKikW1r_wAu1CEHeOmUA@mail.gmail.com
Whole thread Raw
Responses Re: Obsolete comments in ResultRelInfo struct
Re: Obsolete comments in ResultRelInfo struct
List 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



pgsql-hackers by date:

Previous
From: David Geier
Date:
Subject: Understanding ExecShutdownNode()
Next
From: Dagfinn Ilmari Mannsåker
Date:
Subject: Re: Improve tab completion for various SET/RESET forms