aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-08-18 11:33:53 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-08-18 11:36:55 +0200
commit08909e3aee6182a988da5bf5c1b543910ee096c7 (patch)
tree71f420ddbcd8e0f7dec5ab01fc59c573dadc0d99 /src
parentf340f97a13b1455349ee27550623179c018fa036 (diff)
downloadpostgresql-08909e3aee6182a988da5bf5c1b543910ee096c7.tar.gz
postgresql-08909e3aee6182a988da5bf5c1b543910ee096c7.zip
Simplify and clarify an error message
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/copyfromparse.c2
-rw-r--r--src/test/regress/expected/copy.out8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/commands/copyfromparse.c b/src/backend/commands/copyfromparse.c
index 57813b3458b..7cf3e865cfe 100644
--- a/src/backend/commands/copyfromparse.c
+++ b/src/backend/commands/copyfromparse.c
@@ -782,7 +782,7 @@ NextCopyFromRawFields(CopyFromState cstate, char ***fields, int *nfields)
if (fldct != list_length(cstate->attnumlist))
ereport(ERROR,
(errcode(ERRCODE_BAD_COPY_FILE_FORMAT),
- errmsg("wrong number of fields in header line: field count is %d, expected %d",
+ errmsg("wrong number of fields in header line: got %d, expected %d",
fldct, list_length(cstate->attnumlist))));
fldnum = 0;
diff --git a/src/test/regress/expected/copy.out b/src/test/regress/expected/copy.out
index 7f2f4ae4aea..3fad1c52d1f 100644
--- a/src/test/regress/expected/copy.out
+++ b/src/test/regress/expected/copy.out
@@ -201,10 +201,10 @@ copy header_copytest from stdin with (header match);
ERROR: column name mismatch in header line field 3: got null value ("\N"), expected "c"
CONTEXT: COPY header_copytest, line 1: "a b \N"
copy header_copytest from stdin with (header match);
-ERROR: wrong number of fields in header line: field count is 2, expected 3
+ERROR: wrong number of fields in header line: got 2, expected 3
CONTEXT: COPY header_copytest, line 1: "a b"
copy header_copytest from stdin with (header match);
-ERROR: wrong number of fields in header line: field count is 4, expected 3
+ERROR: wrong number of fields in header line: got 4, expected 3
CONTEXT: COPY header_copytest, line 1: "a b c d"
copy header_copytest from stdin with (header match);
ERROR: column name mismatch in header line field 3: got "d", expected "c"
@@ -224,10 +224,10 @@ copy header_copytest (c, a) from stdin with (header match);
copy header_copytest (a, c) from stdin with (header match);
-- errors
copy header_copytest from stdin with (header match);
-ERROR: wrong number of fields in header line: field count is 3, expected 2
+ERROR: wrong number of fields in header line: got 3, expected 2
CONTEXT: COPY header_copytest, line 1: "a ........pg.dropped.2........ c"
copy header_copytest (a, c) from stdin with (header match);
-ERROR: wrong number of fields in header line: field count is 3, expected 2
+ERROR: wrong number of fields in header line: got 3, expected 2
CONTEXT: COPY header_copytest, line 1: "a c b"
SELECT * FROM header_copytest ORDER BY a;
a | c