From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Japin Li <japinli@hotmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Simon Riggs <simon.riggs@enterprisedb.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Daniel Westermann <dwe@dbi-services.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Erik Rijkers <er@xs4all.nl>
Cc: Jaime Casanova <jcasanov@systemguards.com.ec>
Subject: Re: support for MERGE
Date: Fri, 21 Jan 2022 12:37:53 -0300
Message-ID: <202201211537.veim2rt3asdb@alvherre.pgsql> (raw)
In-Reply-To: <MEYP282MB166927C110697BD99388014EB65B9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
On 2022-Jan-21, Japin Li wrote:
> + /*
> + * NOT MATCHED actions can't see target relation, but they can see
> + * source relation.
> + */
> + Assert(mergeWhenClause->commandType == CMD_INSERT ||
> + mergeWhenClause->commandType == CMD_DELETE ||
> + mergeWhenClause->commandType == CMD_NOTHING);
> + setNamespaceVisibilityForRTE(pstate->p_namespace,
> + targetRelRTE, false, false);
> + setNamespaceVisibilityForRTE(pstate->p_namespace,
> + sourceRelRTE, true, true);
>
> Should we remove the CMD_DELETE from Assert(), since it will not happened
> according to MERGE syntax?
Absolutely --- silly copy&paste mistake. Pushed fix.
--
Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/
"Ni aún el genio muy grande llegaría muy lejos
si tuviera que sacarlo todo de su propio interior" (Goethe)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, japinli@hotmail.com, pgsql-hackers@lists.postgresql.org, simon.riggs@enterprisedb.com, tomas.vondra@enterprisedb.com, zyu@yugabyte.com, dwe@dbi-services.com, amitlangote09@gmail.com, pryzby@telsasoft.com, er@xs4all.nl, jcasanov@systemguards.com.ec
Subject: Re: support for MERGE
In-Reply-To: <202201211537.veim2rt3asdb@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox