Fix wrong assertion and poor error messages in "COPY (query) TO".
Tom Lane <tgl@sss.pgh.pa.us>
Fix wrong assertion and poor error messages in "COPY (query) TO". If the query is rewritten into a NOTIFY command by a DO INSTEAD rule, we'd get an assertion failure, or in non-assert builds issue a rather confusing error message. Improve that. Also fix a longstanding grammar mistake in a nearby error message. Per bug #18664 from Alexander Lakhin. Back-patch to all supported branches. Tender Wang and Tom Lane Discussion: https://postgr.es/m/18664-ffd0ebc2386598df@postgresql.org
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/copyto.c | modified | +6 −2 |
| src/test/regress/expected/copydml.out | modified | +7 −3 |
| src/test/regress/sql/copydml.sql | modified | +4 −0 |
Discussion
- BUG #18664: Assert in BeginCopyTo() fails when source DML query rewritten with notifying rule 4 messages · 2024-10-20 → 2024-10-22