summaryrefslogtreecommitdiff
path: root/src/backend/commands/copyto.c
diff options
context:
space:
mode:
authorAlvaro Herrera2024-08-08 19:17:11 +0000
committerAlvaro Herrera2024-08-08 19:17:11 +0000
commit498ee9ee2f4bc7d79f2d91cdd817b2a8f14a664f (patch)
tree862eaa3b98e0b87a8c8cfba86702c3c7a2d80e72 /src/backend/commands/copyto.c
parentd0c8cf2a56fadb08705433bffb301559d97b0712 (diff)
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.
Diffstat (limited to 'src/backend/commands/copyto.c')
-rw-r--r--src/backend/commands/copyto.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/commands/copyto.c b/src/backend/commands/copyto.c
index ae8b2e36d72..eb1d3d8fbb5 100644
--- a/src/backend/commands/copyto.c
+++ b/src/backend/commands/copyto.c
@@ -593,8 +593,9 @@ BeginCopyTo(ParseState *pstate,
if (!list_member_int(cstate->attnumlist, attnum))
ereport(ERROR,
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
- errmsg("FORCE_QUOTE column \"%s\" not referenced by COPY",
- NameStr(attr->attname))));
+ /*- translator: %s is the name of a COPY option, e.g. FORCE_NOT_NULL */
+ errmsg("%s column \"%s\" not referenced by COPY",
+ "FORCE_QUOTE", NameStr(attr->attname))));
cstate->opts.force_quote_flags[attnum - 1] = true;
}
}