1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +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

@ -590,8 +590,8 @@ numeric_in(PG_FUNCTION_ARGS)
if (!isspace((unsigned char) *cp))
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type numeric: \"%s\"",
str)));
errmsg("invalid input syntax for type %s: \"%s\"",
"numeric", str)));
cp++;
}
}
@ -617,8 +617,8 @@ numeric_in(PG_FUNCTION_ARGS)
if (!isspace((unsigned char) *cp))
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type numeric: \"%s\"",
str)));
errmsg("invalid input syntax for type %s: \"%s\"",
"numeric", str)));
cp++;
}
@ -5482,7 +5482,8 @@ set_var_from_str(const char *str, const char *cp, NumericVar *dest)
if (!isdigit((unsigned char) *cp))
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type numeric: \"%s\"", str)));
errmsg("invalid input syntax for type %s: \"%s\"",
"numeric", str)));
decdigits = (unsigned char *) palloc(strlen(cp) + DEC_DIGITS * 2);
@ -5505,8 +5506,8 @@ set_var_from_str(const char *str, const char *cp, NumericVar *dest)
if (have_dp)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type numeric: \"%s\"",
str)));
errmsg("invalid input syntax for type %s: \"%s\"",
"numeric", str)));
have_dp = TRUE;
cp++;
}
@ -5529,8 +5530,8 @@ set_var_from_str(const char *str, const char *cp, NumericVar *dest)
if (endptr == cp)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type numeric: \"%s\"",
str)));
errmsg("invalid input syntax for type %s: \"%s\"",
"numeric", str)));
cp = endptr;
/*
@ -6331,8 +6332,8 @@ numeric_to_double_no_overflow(Numeric num)
/* shouldn't happen ... */
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type double precision: \"%s\"",
tmp)));
errmsg("invalid input syntax for type %s: \"%s\"",
"double precision", tmp)));
}
pfree(tmp);
@ -6357,8 +6358,8 @@ numericvar_to_double_no_overflow(NumericVar *var)
/* shouldn't happen ... */
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type double precision: \"%s\"",
tmp)));
errmsg("invalid input syntax for type %s: \"%s\"",
"double precision", tmp)));
}
pfree(tmp);