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