Reject MERGE in CTEs and COPY
Alvaro Herrera <alvherre@alvh.no-ip.org>
Reject MERGE in CTEs and COPY The grammar added for MERGE inadvertently made it accepted syntax in places that were not prepared to deal with it -- namely COPY and inside CTEs, but invoking these things with MERGE currently causes assertion failures or weird misbehavior in non-assertion builds. Protect those places by checking for it explicitly until somebody decides to implement it. Reported-by: Alexey Borzov <borz_off@cs.msu.su> Discussion: https://postgr.es/m/17579-82482cd7b267b862@postgresql.org
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/copy.c | modified | +6 −0 |
| src/backend/parser/parse_cte.c | modified | +7 −0 |
| src/test/regress/expected/merge.out | modified | +14 −0 |
| src/test/regress/sql/merge.sql | modified | +10 −0 |
Discussion
- BUG #17579: 15beta2: strange error when trying to use MERGE statement as a CTE 10 messages · 2022-08-07 → 2022-08-12