aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-05-16 18:50:56 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-05-16 19:14:31 -0400
commit75445c1515fffa581585f1b72e5b5314c1c395ce (patch)
tree7a1308156552e6f5126e12c679457d8825de42c7 /src/backend/utils
parent3f58cc6dd8fc821992da7ed8099d283b014fc2dc (diff)
downloadpostgresql-75445c1515fffa581585f1b72e5b5314c1c395ce.tar.gz
postgresql-75445c1515fffa581585f1b72e5b5314c1c395ce.zip
More message style fixes
Discussion: https://postgr.es/m/20190515183005.GA26486@alvherre.pgsql
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/jsonpath.c3
-rw-r--r--src/backend/utils/adt/jsonpath_exec.c2
-rw-r--r--src/backend/utils/adt/jsonpath_scan.l10
-rw-r--r--src/backend/utils/adt/pg_locale.c10
-rw-r--r--src/backend/utils/adt/regexp.c14
5 files changed, 24 insertions, 15 deletions
diff --git a/src/backend/utils/adt/jsonpath.c b/src/backend/utils/adt/jsonpath.c
index d53d6d33113..b7f0b4a35e3 100644
--- a/src/backend/utils/adt/jsonpath.c
+++ b/src/backend/utils/adt/jsonpath.c
@@ -179,7 +179,8 @@ jsonPathFromCstring(char *in, int len)
if (!jsonpath)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for jsonpath: \"%s\"", in)));
+ errmsg("invalid input syntax for type %s: \"%s\"", "jsonpath",
+ in)));
flattenJsonPathParseItem(&buf, jsonpath->expr, 0, false);
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 2789ed2371f..b6d6a243e52 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -1934,7 +1934,7 @@ getJsonPathVariable(JsonPathExecContext *cxt, JsonPathItem *variable,
{
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("cannot find jsonpath variable \"%s\"",
+ errmsg("could not find jsonpath variable \"%s\"",
pnstrdup(varName, varNameLength))));
}
diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l
index 6ab7c5c9c64..84d4f297a89 100644
--- a/src/backend/utils/adt/jsonpath_scan.l
+++ b/src/backend/utils/adt/jsonpath_scan.l
@@ -539,7 +539,7 @@ addUnicodeChar(int ch)
{
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for type jsonpath"),
+ errmsg("invalid input syntax for type %s", "jsonpath"),
errdetail("Unicode escape values cannot be used for code "
"point values above 007F when the server encoding "
"is not UTF8.")));
@@ -555,7 +555,7 @@ addUnicode(int ch, int *hi_surrogate)
if (*hi_surrogate != -1)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for type jsonpath"),
+ errmsg("invalid input syntax for type %s", "jsonpath"),
errdetail("Unicode high surrogate must not follow "
"a high surrogate.")));
*hi_surrogate = (ch & 0x3ff) << 10;
@@ -566,7 +566,7 @@ addUnicode(int ch, int *hi_surrogate)
if (*hi_surrogate == -1)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for type jsonpath"),
+ errmsg("invalid input syntax for type %s", "jsonpath"),
errdetail("Unicode low surrogate must follow a high "
"surrogate.")));
ch = 0x10000 + *hi_surrogate + (ch & 0x3ff);
@@ -576,7 +576,7 @@ addUnicode(int ch, int *hi_surrogate)
{
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for type jsonpath"),
+ errmsg("invalid input syntax for type %s", "jsonpath"),
errdetail("Unicode low surrogate must follow a high "
"surrogate.")));
}
@@ -618,7 +618,7 @@ parseUnicode(char *s, int l)
{
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
- errmsg("invalid input syntax for type jsonpath"),
+ errmsg("invalid input syntax for type %s", "jsonpath"),
errdetail("Unicode low surrogate must follow a high "
"surrogate.")));
}
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index da6e2cb5848..2376bda497b 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -1603,7 +1603,7 @@ icu_to_uchar(UChar **buff_uchar, const char *buff, size_t nbytes)
buff, nbytes, &status);
if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR)
ereport(ERROR,
- (errmsg("ucnv_toUChars failed: %s", u_errorName(status))));
+ (errmsg("%s failed: %s", "ucnv_toUChars", u_errorName(status))));
*buff_uchar = palloc((len_uchar + 1) * sizeof(**buff_uchar));
@@ -1612,7 +1612,7 @@ icu_to_uchar(UChar **buff_uchar, const char *buff, size_t nbytes)
buff, nbytes, &status);
if (U_FAILURE(status))
ereport(ERROR,
- (errmsg("ucnv_toUChars failed: %s", u_errorName(status))));
+ (errmsg("%s failed: %s", "ucnv_toUChars", u_errorName(status))));
return len_uchar;
}
@@ -1641,7 +1641,8 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
buff_uchar, len_uchar, &status);
if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR)
ereport(ERROR,
- (errmsg("ucnv_fromUChars failed: %s", u_errorName(status))));
+ (errmsg("%s failed: %s", "ucnv_fromUChars",
+ u_errorName(status))));
*result = palloc(len_result + 1);
@@ -1650,7 +1651,8 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
buff_uchar, len_uchar, &status);
if (U_FAILURE(status))
ereport(ERROR,
- (errmsg("ucnv_fromUChars failed: %s", u_errorName(status))));
+ (errmsg("%s failed: %s", "ucnv_fromUChars",
+ u_errorName(status))));
return len_result;
}
diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c
index ab44846e0b3..c5be472bced 100644
--- a/src/backend/utils/adt/regexp.c
+++ b/src/backend/utils/adt/regexp.c
@@ -423,7 +423,7 @@ parse_re_flags(pg_re_flags *flags, text *opts)
default:
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("invalid regexp option: \"%c\"",
+ errmsg("invalid regular expression option: \"%c\"",
opt_p[i])));
break;
}
@@ -920,7 +920,9 @@ regexp_match(PG_FUNCTION_ARGS)
if (re_flags.glob)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("regexp_match does not support the global option"),
+ /* translator: %s is a SQL function name */
+ errmsg("%s does not support the \"global\" option",
+ "regexp_match()"),
errhint("Use the regexp_matches function instead.")));
matchctx = setup_regexp_matches(orig_str, pattern, &re_flags,
@@ -1298,7 +1300,9 @@ regexp_split_to_table(PG_FUNCTION_ARGS)
if (re_flags.glob)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("regexp_split_to_table does not support the global option")));
+ /* translator: %s is a SQL function name */
+ errmsg("%s does not support the \"global\" option",
+ "regexp_split_to_table()")));
/* But we find all the matches anyway */
re_flags.glob = true;
@@ -1351,7 +1355,9 @@ regexp_split_to_array(PG_FUNCTION_ARGS)
if (re_flags.glob)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("regexp_split_to_array does not support the global option")));
+ /* translator: %s is a SQL function name */
+ errmsg("%s does not support the \"global\" option",
+ "regexp_split_to_array()")));
/* But we find all the matches anyway */
re_flags.glob = true;