aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-05-05 17:06:53 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2019-05-05 17:06:53 -0400
commitbd5e8b627bae9e394352a388d2ad30465eafea2c (patch)
tree547d4c6fba27ccc7d0eb0e4d2e2c13faaf299d69
parent9691aa72e2a7fb146ac759e1f8a8b04962128cc0 (diff)
downloadpostgresql-bd5e8b627bae9e394352a388d2ad30465eafea2c.tar.gz
postgresql-bd5e8b627bae9e394352a388d2ad30465eafea2c.zip
Bring pg_nextoid()'s error messages into line with message style guide.
Noticed while reviewing nearby code. Given all the disclaimers about this not being meant as user-facing code, I wonder whether we should make these non-translatable? But in any case there's little excuse for them not to be good English.
-rw-r--r--src/backend/catalog/catalog.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c
index c39da41d2ec..6d8c7460572 100644
--- a/src/backend/catalog/catalog.c
+++ b/src/backend/catalog/catalog.c
@@ -479,7 +479,7 @@ pg_nextoid(PG_FUNCTION_ARGS)
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("must be superuser to call pg_nextoid")));
+ errmsg("must be superuser to call pg_nextoid()")));
rel = table_open(reloid, RowExclusiveLock);
idx = index_open(idxoid, RowExclusiveLock);
@@ -487,21 +487,21 @@ pg_nextoid(PG_FUNCTION_ARGS)
if (!IsSystemRelation(rel))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("pg_nextoid() can only be used on system relation")));
+ errmsg("pg_nextoid() can only be used on system catalogs")));
if (idx->rd_index->indrelid != RelationGetRelid(rel))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("index %s does not belong to table %s",
+ errmsg("index \"%s\" does not belong to table \"%s\"",
RelationGetRelationName(idx),
RelationGetRelationName(rel))));
atttuple = SearchSysCacheAttName(reloid, NameStr(*attname));
if (!HeapTupleIsValid(atttuple))
ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("attribute %s does not exists",
- NameStr(*attname))));
+ (errcode(ERRCODE_UNDEFINED_COLUMN),
+ errmsg("column \"%s\" of relation \"%s\" does not exist",
+ NameStr(*attname), RelationGetRelationName(rel))));
attform = ((Form_pg_attribute) GETSTRUCT(atttuple));
attno = attform->attnum;
@@ -509,14 +509,14 @@ pg_nextoid(PG_FUNCTION_ARGS)
if (attform->atttypid != OIDOID)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("attribute %s is not of type oid",
+ errmsg("column \"%s\" is not of type oid",
NameStr(*attname))));
if (IndexRelationGetNumberOfKeyAttributes(idx) != 1 ||
idx->rd_index->indkey.values[0] != attno)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("index %s is not the index for attribute %s",
+ errmsg("index \"%s\" is not the index for column \"%s\"",
RelationGetRelationName(idx),
NameStr(*attname))));