diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2023-10-20 22:52:15 +0200 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2023-10-20 22:52:15 +0200 |
commit | 36a14afc076024ba48c399f2af2d4cd1b2c39348 (patch) | |
tree | 11377ea92401f17a3ef42a8d5593ebcc98ba009e /src/backend/commands/tablecmds.c | |
parent | 41da94fd5c7418838ec7c49456b69c462013ea57 (diff) | |
download | postgresql-36a14afc076024ba48c399f2af2d4cd1b2c39348.tar.gz postgresql-36a14afc076024ba48c399f2af2d4cd1b2c39348.zip |
Make some error strings more generic
It's undesirable to have SQL commands or configuration options in a
translatable error string, so take some of these out.
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index fb48772fd50..416a98e7cef 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -7996,7 +7996,9 @@ ATExecColumnDefault(Relation rel, const char *colName, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("column \"%s\" of relation \"%s\" is an identity column", colName, RelationGetRelationName(rel)), - newDefault ? 0 : errhint("Use ALTER TABLE ... ALTER COLUMN ... DROP IDENTITY instead."))); + /* translator: %s is an SQL ALTER command */ + newDefault ? 0 : errhint("Use %s instead.", + "ALTER TABLE ... ALTER COLUMN ... DROP IDENTITY"))); if (TupleDescAttr(tupdesc, attnum - 1)->attgenerated) ereport(ERROR, @@ -8004,7 +8006,9 @@ ATExecColumnDefault(Relation rel, const char *colName, errmsg("column \"%s\" of relation \"%s\" is a generated column", colName, RelationGetRelationName(rel)), newDefault || TupleDescAttr(tupdesc, attnum - 1)->attgenerated != ATTRIBUTE_GENERATED_STORED ? 0 : - errhint("Use ALTER TABLE ... ALTER COLUMN ... DROP EXPRESSION instead."))); + /* translator: %s is an SQL ALTER command */ + errhint("Use %s instead.", + "ALTER TABLE ... ALTER COLUMN ... DROP EXPRESSION"))); /* * Remove any old default for the column. We use RESTRICT here for @@ -14534,7 +14538,9 @@ ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing, LOCKMODE lock (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("\"%s\" is a composite type", NameStr(tuple_class->relname)), - errhint("Use ALTER TYPE instead."))); + /* translator: %s is an SQL ALTER command */ + errhint("Use %s instead.", + "ALTER TYPE"))); break; case RELKIND_TOASTVALUE: if (recursing) @@ -17942,7 +17948,9 @@ RangeVarCallbackForAlterRelation(const RangeVar *rv, Oid relid, Oid oldrelid, ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("\"%s\" is a composite type", rv->relname), - errhint("Use ALTER TYPE instead."))); + /* translator: %s is an SQL ALTER command */ + errhint("Use %s instead.", + "ALTER TYPE"))); /* * Don't allow ALTER TABLE .. SET SCHEMA on relations that can't be moved @@ -17961,7 +17969,9 @@ RangeVarCallbackForAlterRelation(const RangeVar *rv, Oid relid, Oid oldrelid, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot change schema of composite type \"%s\"", rv->relname), - errhint("Use ALTER TYPE instead."))); + /* translator: %s is an SQL ALTER command */ + errhint("Use %s instead.", + "ALTER TYPE"))); else if (relkind == RELKIND_TOASTVALUE) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), |