Re: ON CONFLICT DO UPDATE for partitioned tables

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, 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-18 04:17:15
Message-ID: 20180318041715.xvn6lwiv23pcdbny@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera wrote:

> I think what I should be doing is the same as the returning stuff: keep
> a tupdesc around, and use a single slot, whose descriptor is changed
> just before the projection.

Yes, this works, though it's ugly. Not any uglier than what's already
there, though, so I think it's okay.

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.

0001 should be pretty much ready to push -- adjustments to ExecInsert
and ModifyTableState I already mentioned.

0002 is stuff I would like to get rid of completely -- changes to
planner code so that it better supports functionality we need for

0003 is the main patch. Compared to the previous version, this one
reuses slots by switching them to different tupdescs as needed.

Álvaro Herrera
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v4-0001-Simplify-ExecInsert-API-re.-ON-CONFLICT-data.patch text/plain 4.5 KB
v4-0002-Make-some-static-functions-work-on-TupleDesc-rath.patch text/plain 7.2 KB
v4-0003-Fix-ON-CONFLICT-to-work-with-partitioned-tables.patch text/plain 37.8 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Isaac Morland 2018-03-18 05:08:23 Recently-introduced segfault in initdb?
Previous Message Peter Geoghegan 2018-03-18 02:24:36 Re: [GSoC 2018] Proposal Draft