Re: BUG #17579: 15beta2: strange error when trying to use MERGE statement as a CTE

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: borz_off(at)cs(dot)msu(dot)su, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: BUG #17579: 15beta2: strange error when trying to use MERGE statement as a CTE
Date: 2022-08-11 02:41:37
Message-ID: CAMbWs4-Zdeq+0c3npMGihZbGztR8WvWMs7XuSqKp8OLeg3HHOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Aug 8, 2022 at 10:21 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> It evidently wasn't ever *tested*, but in principle I think it ought
> to work. I'm not sure how much effort will be involved to make that
> happen. At this point we might have to disallow it for v15 and
> come back to the problem later.

Seems we neglect to think of MERGE statements when we transform WITH
clauses and when we rewrite the query. If we add the check against MERGE
statement in parse_cte.c and in rewriteHandler.c, the query in problem
can work. But I'm not sure if that's enough.

+1 to disallow it for now.

Thanks
Richard

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Turoň 2022-08-11 10:17:10 Re: BUG #17206: the function array_cat(anyarray, anyarray) does not exist
Previous Message Alexander Pyhalov 2022-08-10 15:16:59 Re: foreign join error "variable not found in subplan target list"