Skip to content

Commit bd5e8b6

Browse files
committed
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.
1 parent 9691aa7 commit bd5e8b6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/backend/catalog/catalog.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -479,44 +479,44 @@ pg_nextoid(PG_FUNCTION_ARGS)
479479
if (!superuser())
480480
ereport(ERROR,
481481
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
482-
errmsg("must be superuser to call pg_nextoid")));
482+
errmsg("must be superuser to call pg_nextoid()")));
483483

484484
rel = table_open(reloid, RowExclusiveLock);
485485
idx = index_open(idxoid, RowExclusiveLock);
486486

487487
if (!IsSystemRelation(rel))
488488
ereport(ERROR,
489489
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
490-
errmsg("pg_nextoid() can only be used on system relation")));
490+
errmsg("pg_nextoid() can only be used on system catalogs")));
491491

492492
if (idx->rd_index->indrelid != RelationGetRelid(rel))
493493
ereport(ERROR,
494494
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
495-
errmsg("index %s does not belong to table %s",
495+
errmsg("index \"%s\" does not belong to table \"%s\"",
496496
RelationGetRelationName(idx),
497497
RelationGetRelationName(rel))));
498498

499499
atttuple = SearchSysCacheAttName(reloid, NameStr(*attname));
500500
if (!HeapTupleIsValid(atttuple))
501501
ereport(ERROR,
502-
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
503-
errmsg("attribute %s does not exists",
504-
NameStr(*attname))));
502+
(errcode(ERRCODE_UNDEFINED_COLUMN),
503+
errmsg("column \"%s\" of relation \"%s\" does not exist",
504+
NameStr(*attname), RelationGetRelationName(rel))));
505505

506506
attform = ((Form_pg_attribute) GETSTRUCT(atttuple));
507507
attno = attform->attnum;
508508

509509
if (attform->atttypid != OIDOID)
510510
ereport(ERROR,
511511
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
512-
errmsg("attribute %s is not of type oid",
512+
errmsg("column \"%s\" is not of type oid",
513513
NameStr(*attname))));
514514

515515
if (IndexRelationGetNumberOfKeyAttributes(idx) != 1 ||
516516
idx->rd_index->indkey.values[0] != attno)
517517
ereport(ERROR,
518518
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
519-
errmsg("index %s is not the index for attribute %s",
519+
errmsg("index \"%s\" is not the index for column \"%s\"",
520520
RelationGetRelationName(idx),
521521
NameStr(*attname))));
522522

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy