Re: support for MERGE
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Amit Langote <amitlangote09@gmail.com>, Japin Li <japinli@hotmail.com>, Zhihong Yu <zyu@yugabyte.com>, Simon Riggs <simon.riggs@enterprisedb.com>, Pg Hackers <pgsql-hackers@lists.postgresql.org>, Tomas Vondra <tomas.vondra@enterprisedb.com>, Daniel Westermann <dwe@dbi-services.com>, Erik Rijkers <er@xs4all.nl>, Jaime Casanova <jcasanov@systemguards.com.ec>, Andres Freund <andres@anarazel.de>
Date: 2022-03-20T18:40:06Z
Lists: pgsql-hackers
Attachments
- v19-0001-MERGE-SQL-Command-following-SQL-2016.patch (text/x-diff)
On 2022-Mar-18, Peter Eisentraut wrote: > 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. Thanks. I've merged these changes into this new v19. Apart from rebasing on top of current master (which it had conflicts with), I've also changed strategy for the tuple counters: Andres complained that the addition of nfiltered3 was too messy, and I have to agree. After trying to deal with it in other ways, I ended up deciding that it wasn't worth it, and just added ad-hoc tuple counters to ModifyTableState. We use this technique in other executor state nodes, so it's not anything new. > 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. This argument makes sense to me, so I'll be doing that unless somebody objects to the idea. > 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. Too true, too true ... -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "El sudor es la mejor cura para un pensamiento enfermo" (Bardia)
Commits
-
Doc fixes for MERGE statement
- 5dcebd10baa8 16.0 landed
- 5bb88967ed5c 15.0 landed
-
MERGE docs adjustments
- d6d1fbf353d1 15.0 landed
- 3d895bc846f2 16.0 landed
-
Link to MVCC docs in MERGE docs
- ffffeebf2447 15.0 landed
-
Fix EXPLAIN MERGE output when no tuples are processed
- 12e423e21d8e 15.0 landed
-
Make EXPLAIN MERGE output format more compact
- 598ac10be1c2 15.0 landed
-
Add support for MERGE SQL command
- 7103ebb7aae8 15.0 landed
-
Split ExecUpdate and ExecDelete into reusable pieces
- 25e777cf8e54 15.0 landed
-
Add API of sorts for transition table handling in trigger.c
- 3a46a45f6f00 15.0 landed
-
Represent Lists as expansible arrays, not chains of cons-cells.
- 1cff1b95ab6d 13.0 cited