Re: MERGE bug report

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Joe Wildish <joe(at)lateraljoin(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: MERGE bug report
Date: 2022-04-12 07:47:47
Message-ID: 202204120747.ztq5ae6zbzew@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Apr-11, Richard Guo wrote:

> At first I was wondering whether we need to also include vars used in
> each action's targetlist, just as what we did for each action's qual.
> Then later I realized parse_merge.c already did that. But now it looks
> much better to process them two in preprocess_targetlist.

Yeah. I pushed that.

However, now EXPLAIN VERBOSE doesn't show the columns from the source
relation in the Output line --- I think only those that are used as join
quals are shown, thanks to distribute_quals_to_rels. I think it would
be better to fix this. Maybe expanding the source target list earlier
is called for, after all. I looked at transformUpdateStmt and siblings
for inspiration, but came out blank.

> A minor comment is that we can use list_concat_copy(list1, list2)
> instead of list_concat(list_copy(list1), list2) for better efficiency.

Thanks for that tip.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"La vida es para el que se aventura"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message sirisha chamarthi 2022-04-12 07:47:54 Unable to connect to Postgres13 server from psql client built on master
Previous Message bucoo@sohu.com 2022-04-12 06:57:16 fix cost subqueryscan wrong parallel cost