aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands
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/commands
parent716c7d4b242f0a64ad8ac4dc48c6fed6557ba12c (diff)
downloadpostgresql-9a34123bc315e55b33038464422ef1cd2b67dab2.tar.gz
postgresql-9a34123bc315e55b33038464422ef1cd2b67dab2.zip
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/commands')
-rw-r--r--src/backend/commands/functioncmds.c12
-rw-r--r--src/backend/commands/proclang.c5
-rw-r--r--src/backend/commands/trigger.c5
3 files changed, 14 insertions, 8 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index 015a5fb67df..22aecb24f92 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -1482,11 +1482,13 @@ CreateCast(CreateCastStmt *stmt)
if (nargs > 1 && procstruct->proargtypes.values[1] != INT4OID)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
- errmsg("second argument of cast function must be type integer")));
+ errmsg("second argument of cast function must be type %s",
+ "integer")));
if (nargs > 2 && procstruct->proargtypes.values[2] != BOOLOID)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
- errmsg("third argument of cast function must be type boolean")));
+ errmsg("third argument of cast function must be type %s",
+ "boolean")));
if (!IsBinaryCoercible(procstruct->prorettype, targettypeid))
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
@@ -1776,7 +1778,8 @@ check_transform_function(Form_pg_proc procstruct)
if (procstruct->proargtypes.values[0] != INTERNALOID)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
- errmsg("first argument of transform function must be type \"internal\"")));
+ errmsg("first argument of transform function must be type %s",
+ "internal")));
}
@@ -1859,7 +1862,8 @@ CreateTransform(CreateTransformStmt *stmt)
if (procstruct->prorettype != INTERNALOID)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
- errmsg("return data type of FROM SQL function must be \"internal\"")));
+ errmsg("return data type of FROM SQL function must be %s",
+ "internal")));
check_transform_function(procstruct);
ReleaseSysCache(tuple);
}
diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c
index c5ce5bdd117..b684f413c06 100644
--- a/src/backend/commands/proclang.c
+++ b/src/backend/commands/proclang.c
@@ -278,8 +278,9 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
{
ereport(WARNING,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("changing return type of function %s from \"opaque\" to \"language_handler\"",
- NameListToString(stmt->plhandler))));
+ errmsg("changing return type of function %s from %s to %s",
+ NameListToString(stmt->plhandler),
+ "opaque", "language_handler")));
SetFunctionReturnType(handlerOid, LANGUAGE_HANDLEROID);
}
else
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index b404d1ea16f..3fc3a21cee8 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -522,8 +522,9 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
if (funcrettype == OPAQUEOID)
{
ereport(WARNING,
- (errmsg("changing return type of function %s from \"opaque\" to \"trigger\"",
- NameListToString(stmt->funcname))));
+ (errmsg("changing return type of function %s from %s to %s",
+ NameListToString(stmt->funcname),
+ "opaque", "trigger")));
SetFunctionReturnType(funcoid, TRIGGEROID);
}
else