Re: support for MERGE

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Daniel Westermann <dwe(at)dbi-services(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: support for MERGE
Date: 2022-03-12 03:53:47
Message-ID: 202203120353.sdof7mld5qfc@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Mar-09, Zhihong Yu wrote:

> Hi,
> For v14-0002-Split-ExecUpdate-and-ExecDelete-in-reusable-piec.patch :
>
> + TupleTableSlot *insertProjectedTuple;
>
> With `insert` at the beginning of the variable name, someone may think it
> is a verb. How about naming the variable projectedTupleFromInsert (or
> something similar) ?

I went with projectedFromInsert. I don't feel a need to call it a
"tuple" because it's already a TupleTableSlot * ...

> + if (!ExecBRDeleteTriggers(context->estate, context->epqstate,
> + resultRelInfo, tupleid, oldtuple,
> + epqreturnslot))
> + /* some trigger made the delete a no-op; let caller know */
> + return false;
>
> It seems you can directly return the value returned
> from ExecBRDeleteTriggers().

True, let's do that.

On 2022-Mar-10, Simon Riggs wrote:

> Various cases were not tested in the patch - additional patch
> attached, but nothing surprising there.

Thanks, incorporated here.

This is mostly just a rebase to keep cfbot happy.

--
Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/
"La gente vulgar sólo piensa en pasar el tiempo;
el que tiene talento, en aprovecharlo"

Attachment Content-Type Size
v15-0001-Split-ExecUpdate-and-ExecDelete-in-reusable-piec.patch text/x-diff 38.8 KB
v15-0002-MERGE-SQL-Command-following-SQL-2016.patch text/x-diff 379.8 KB
v15-0003-can-use-return-value-of-called-function-directly.patch text/x-diff 2.0 KB
v15-0004-test-additions-from-Simon.patch text/x-diff 4.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-03-12 04:30:14 Re: Column Filtering in Logical Replication
Previous Message Jeff Davis 2022-03-12 03:24:12 Re: pg_walinspect - a new extension to get raw WAL data and WAL stats