Re: ON CONFLICT DO UPDATE for partitioned tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: ON CONFLICT DO UPDATE for partitioned tables
Date
Msg-id 20180316182106.s7ag67mvwgghnyp2@alvherre.pgsql
Whole thread Raw
In response to Re: ON CONFLICT DO UPDATE for partitioned tables  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: ON CONFLICT DO UPDATE for partitioned tables
List pgsql-hackers
So ExecInsert receives the ModifyTableState, and separately it receives
arbiterIndexes and the OnConflictAction, both of which are members of
the passed ModifyTableState.  I wonder why does it do that; wouldn't it
be simpler to extract those members from the node?

With the patch proposed upthread, we receive arbiterIndexes as a
parameter and if the table is a partition we summarily ignore those and
use the list as extracted from the PartitionRoutingInfo.  This is
confusing and pointless.  It seems to me that the logic ought to be "if
partition then use the list in PartitionRoutingInfo; if not partition
use it from ModifyTableState".  This requires changing as per above,
i.e. make the arbiter index list not part of the ExecInsert's API.

The OnConflictAction doesn't matter much; not passing it is merely a
matter of cleanliness.

Or is there another reason to pass the index list?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: PL/pgSQL nested CALL with transactions
Next
From: Peter Geoghegan
Date:
Subject: Re: ON CONFLICT DO UPDATE for partitioned tables