Re: ON CONFLICT DO UPDATE for partitioned tables
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-02-28T16:03:57Z
Lists: pgsql-hackers
On Tue, Feb 27, 2018 at 7:46 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> I updated Amit Langote's patch for INSERT ON CONFLICT DO UPDATE[1].
> Following the lead of edd44738bc88 ("Be lazier about partition tuple
> routing.") this incarnation only does the necessary push-ups for the
> specific partition that needs it, at execution time. As far as I can
> tell, it works as intended.
>
> I chose to refuse the case where the DO UPDATE clause causes the tuple
> to move to another partition (i.e. you're updating the partition key of
> the tuple). While it's probably possible to implement that, it doesn't
> seem a very productive use of time.
I would have thought that to be the only case we could support with
the current infrastructure. Doesn't a correct implementation for any
other case require a global index?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Commits
-
Remove quick path in ExecInitPartitionInfo for equal tupdescs
- 79b2e52615fa 11.0 landed
-
Ignore whole-rows in INSERT/CONFLICT with partitioned tables
- 158b7bc6d779 11.0 landed
-
Handle INSERT .. ON CONFLICT with partitioned tables
- 555ee77a9668 11.0 landed
-
Remove unnecessary members from ModifyTableState and ExecInsert
- ee0a1fc84eb2 11.0 landed