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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Richard Guo <guofenglinux@gmail.com>, borz_off@cs.msu.su, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-08-11T13:37:08Z
Lists: pgsql-bugs
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2022-Aug-11, Richard Guo wrote:
>> +1 to disallow it for now.

> This patch does that.

The parse error location seems quite oddly chosen.  Can you make
it point at the MERGE instead?  I think exprLocation(cte->ctequery)
might work, but not sure.

			regards, tom lane



Commits

  1. Reject MERGE in CTEs and COPY