Re: ON CONFLICT DO UPDATE for partitioned tables

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: ON CONFLICT DO UPDATE for partitioned tables
Date: 2018-03-19 12:59:01
Message-ID: 5AAFB415.8070305@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(2018/03/18 13:17), Alvaro Herrera wrote:
> Alvaro Herrera wrote:
> The only thing that I remain unhappy about this patch is the whole
> adjust_and_expand_partition_tlist() thing. I fear we may be doing
> redundant and/or misplaced work. I'll look into it next week.

I'm still reviewing the patches, but I really agree on that point. As
Pavan mentioned upthread, the onConflictSet tlist for the root parent,
from which we create a translated onConflictSet tlist for a partition,
would have already been processed by expand_targetlist() to contain all
missing columns as well, so I think we could create the tlist for the
partition by simply re-ordering the expression-converted tlist (ie,
conv_setproj) based on the conversion map for the partition. The
Attached defines a function for that, which could be called, instead of
calling adjust_and_expand_partition_tlist(). This would allow us to get
rid of planner changes from the patches. Maybe I'm missing something,
though.

Best regards,
Etsuro Fujita

Attachment Content-Type Size
simplify-tlist-adjustment.patch text/x-diff 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-19 13:38:18 Re: inserts into partitioned table may cause crash
Previous Message Ildus Kurbangaliev 2018-03-19 12:38:39 Re: [PROPOSAL] Shared Ispell dictionaries