Re: support for MERGE

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Japin Li <japinli(at)hotmail(dot)com>
Cc: Zhihong Yu <zyu(at)yugabyte(dot)com>, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>, 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>, 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-18 11:05:03
Message-ID: 45e551a6-f378-0252-a432-8b2716b1a55d@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17.03.22 12:31, Alvaro Herrera wrote:
> 0001 pushed. Here's 0002 again for cfbot, with no changes other than
> pgindent cleanup.

I did a cursory read through and want to offer some trivial amendments
in the attached patches. The 0001 adds back various serial commas, the
0002 is assorted other stuff.

One functional change I recommend is the tab completion of the MERGE
target. I think the filtering in Query_for_list_of_mergetargets is a
bit too particular. For example, if a table is a possible MERGE target,
and then someone adds a rule, it will disappear from the completions,
without explanation, which could be confusing. I think we can be
generous in what we accept and then let the actual parse analysis
provide suitable error messages. Also, consider forward-compatibility
if support for further targets is added. I would consider dropping
Query_for_list_of_mergetargets and just using Query_for_list_of_updatables.

In any case, the min_server_version could be dropped. That is usually
only used if the query would fail in an older version, but not if the
command being completed wouldn't work. For example, we don't restrict
in what versions you can complete partitioned indexes.

Attachment Content-Type Size
0001-fixup-MERGE-SQL-Command-following-SQL-2016.patch text/plain 6.7 KB
0002-fixup-MERGE-SQL-Command-following-SQL-2016.patch text/plain 12.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2022-03-18 11:12:34 Re: Commitfest Update
Previous Message Amit Kapila 2022-03-18 10:50:07 Re: Logical replication timeout problem