summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/cash.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2017-01-18 16:08:20 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2017-01-18 16:08:20 -0300
commit9a34123bc315e55b33038464422ef1cd2b67dab2 (patch)
tree9b1e2e9189e7b60e7eb2876e365c5a950a6aa228 /src/backend/utils/adt/cash.c
parent716c7d4b242f0a64ad8ac4dc48c6fed6557ba12c (diff)
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 f402b9950120. Discussion: https://postgr.es/m/20160401170642.GA57509@alvherre.pgsql
Diffstat (limited to 'src/backend/utils/adt/cash.c')
-rw-r--r--src/backend/utils/adt/cash.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c
index a146b0a0bc8..ac8f74fee63 100644
--- a/src/backend/utils/adt/cash.c
+++ b/src/backend/utils/adt/cash.c
@@ -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;