mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
Make messages mentioning type names more uniform
This avoids additional translatable strings for each distinct type, as
well as making our quoting style around type names more consistent
(namely, that we don't quote type names). This continues what started
as f402b99501.
Discussion: https://postgr.es/m/20160401170642.GA57509@alvherre.pgsql
This commit is contained in:
@@ -41,8 +41,8 @@ oidin_subr(const char *s, char **endloc)
|
||||
if (*s == '\0')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("invalid input syntax for type oid: \"%s\"",
|
||||
s)));
|
||||
errmsg("invalid input syntax for type %s: \"%s\"",
|
||||
"oid", s)));
|
||||
|
||||
errno = 0;
|
||||
cvt = strtoul(s, &endptr, 10);
|
||||
@@ -55,19 +55,20 @@ oidin_subr(const char *s, char **endloc)
|
||||
if (errno && errno != ERANGE && errno != EINVAL)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("invalid input syntax for type oid: \"%s\"",
|
||||
s)));
|
||||
errmsg("invalid input syntax for type %s: \"%s\"",
|
||||
"oid", s)));
|
||||
|
||||
if (endptr == s && *s != '\0')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("invalid input syntax for type oid: \"%s\"",
|
||||
s)));
|
||||
errmsg("invalid input syntax for type %s: \"%s\"",
|
||||
"oid", s)));
|
||||
|
||||
if (errno == ERANGE)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
|
||||
errmsg("value \"%s\" is out of range for type oid", s)));
|
||||
errmsg("value \"%s\" is out of range for type %s",
|
||||
s, "oid")));
|
||||
|
||||
if (endloc)
|
||||
{
|
||||
@@ -82,8 +83,8 @@ oidin_subr(const char *s, char **endloc)
|
||||
if (*endptr)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("invalid input syntax for type oid: \"%s\"",
|
||||
s)));
|
||||
errmsg("invalid input syntax for type %s: \"%s\"",
|
||||
"oid", s)));
|
||||
}
|
||||
|
||||
result = (Oid) cvt;
|
||||
@@ -105,7 +106,8 @@ oidin_subr(const char *s, char **endloc)
|
||||
cvt != (unsigned long) ((int) result))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
|
||||
errmsg("value \"%s\" is out of range for type oid", s)));
|
||||
errmsg("value \"%s\" is out of range for type %s",
|
||||
s, "oid")));
|
||||
#endif
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user