Refactor error messages to reduce duplication
Alvaro Herrera <alvherre@alvh.no-ip.org>
Refactor error messages to reduce duplication
I also took the liberty of changing
errmsg("COPY DEFAULT only available using COPY FROM")
to
errmsg("COPY %s cannot be used with %s", "DEFAULT", "COPY TO")
because the original wording is unlike all other messages that indicate
option incompatibility. This message was added by commit 9f8377f7a279
(16-era), in whose development thread there was no discussion on this
point.
Backpatch to 17.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/copy.c | modified | +55 −21 |
| src/backend/commands/copyfrom.c | modified | +6 −4 |
| src/backend/commands/copyto.c | modified | +3 −2 |
| src/test/regress/expected/copy2.out | modified | +2 −2 |