1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +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:
Alvaro Herrera
2017-01-18 16:08:20 -03:00
parent 716c7d4b24
commit 9a34123bc3
26 changed files with 155 additions and 129 deletions

View File

@ -209,8 +209,8 @@ cash_in(PG_FUNCTION_ARGS)
if (newvalue / 10 != value)
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("value \"%s\" is out of range for type money",
str)));
errmsg("value \"%s\" is out of range for type %s",
str, "money")));
value = newvalue;
@ -236,8 +236,8 @@ cash_in(PG_FUNCTION_ARGS)
if (value > 0)
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("value \"%s\" is out of range for type money",
str)));
errmsg("value \"%s\" is out of range for type %s",
str, "money")));
/* adjust for less than required decimal places */
for (; dec < fpoint; dec++)
@ -247,8 +247,8 @@ cash_in(PG_FUNCTION_ARGS)
if (newvalue / 10 != value)
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("value \"%s\" is out of range for type money",
str)));
errmsg("value \"%s\" is out of range for type %s",
str, "money")));
value = newvalue;
}
@ -276,8 +276,8 @@ cash_in(PG_FUNCTION_ARGS)
else
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type money: \"%s\"",
str)));
errmsg("invalid input syntax for type %s: \"%s\"",
"money", str)));
}
/* If the value is supposed to be positive, flip the sign, but check for
@ -288,8 +288,8 @@ cash_in(PG_FUNCTION_ARGS)
if (result < 0)
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("value \"%s\" is out of range for type money",
str)));
errmsg("value \"%s\" is out of range for type %s",
str, "money")));
}
else
result = value;