pgsql: Refactor error messages to reduce duplication

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor error messages to reduce duplication
Date: 2024-08-08 19:18:52
Message-ID: E1sc8ey-003J3n-0n@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/28b953f26343105ebf3a1a212092e2c3c0bb0914

Modified Files
--------------
src/backend/commands/copy.c | 76 +++++++++++++++++++++++++++----------
src/backend/commands/copyfrom.c | 10 +++--
src/backend/commands/copyto.c | 5 ++-
src/test/regress/expected/copy2.out | 4 +-
4 files changed, 66 insertions(+), 29 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2024-08-08 23:36:46 pgsql: Refuse ATTACH of a table referenced by a foreign key
Previous Message Alexander Korotkov 2024-08-08 08:51:17 Re: pgsql: Introduce hash_search_with_hash_value() function