Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbd5e8b6

Browse files
committed
Bring pg_nextoid()'s error messages into line with message style guide.
Noticed while reviewing nearby code. Given all the disclaimers aboutthis not being meant as user-facing code, I wonder whether we shouldmake these non-translatable? But in any case there's little excusefor them not to be good English.
1 parent9691aa7 commitbd5e8b6

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 systemrelation")));
490+
errmsg("pg_nextoid() can only be used on systemcatalogs")));
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 %sdoes notexists",
504-
NameStr(*attname))));
502+
(errcode(ERRCODE_UNDEFINED_COLUMN),
503+
errmsg("column \"%s\" of relation \"%s\"does notexist",
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 forattribute %s",
519+
errmsg("index\"%s\" is not the index forcolumn \"%s\"",
520520
RelationGetRelationName(idx),
521521
NameStr(*attname))));
522522

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp