A problem in ExecModifyTable - Mailing list pgsql-hackers

From 李杰(慎追)
Subject A problem in ExecModifyTable
Date
Msg-id 9d5f2dfd-db10-47f2-b97a-61d5a40e4454.adger.lj@alibaba-inc.com
Whole thread Raw
Responses Re: A problem in ExecModifyTable
List pgsql-hackers
Hi hackers,
    Recently, I noticed a great patch in pg 14.
"Rework planning and execution of UPDATE and DELETE. (86dc90056dfdbd9d1b891718d2e5614e3e432f35)"
This changes the DML execution of the partitioned table and makes it more friendly.
 But I am very confused about the following changes:
```
+           relkind = resultRelInfo->ri_RelationDesc->rd_rel->relkind;
+           if (relkind == RELKIND_RELATION ||
+               relkind == RELKIND_MATVIEW ||
+               relkind == RELKIND_PARTITIONED_TABLE)
            {
-               char        relkind;
-               Datum       datum;
-               bool        isNull;
-
-               relkind = resultRelInfo->ri_RelationDesc->rd_rel->relkind;
-               if (relkind == RELKIND_RELATION || relkind == RELKIND_MATVIEW)
-               {
-                   datum = ExecGetJunkAttribute(slot,
-                                                junkfilter->jf_junkAttNo,
-                                                &isNull);
-                   /* shouldn't ever get a null result... */
```
According to my understanding, the parent table of a partitioned table does not store any tuples. 
Then why is "relkind = = RELKIND_PARTITIONED_TABLE" suddenly added here ?

There is no comment on this point in the code. 
Can you answer my confusion? Be deeply grateful.

Regards & Thanks Adger


        


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: PG14: Avoid checking output-buffer-length for every encoded byte during pg_hex_encode
Next
From: Michael Paquier
Date:
Subject: Re: return correct error code from pgtls_init