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

Commit70600bd

Browse files
author
Thomas G. Lockhart
committed
Clean up error messages.
1 parent681c587 commit70600bd

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

‎src/backend/catalog/heap.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.74 1999/02/13 23:14:55 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.75 1999/02/23 07:54:03 thomas Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -197,8 +197,8 @@ heap_create(char *relname,
197197

198198
if (relname&&IsSystemRelationName(relname)&&IsNormalProcessingMode())
199199
{
200-
elog(ERROR,
201-
"Illegal class name: %s -- pg_ is reserved for system catalogs",
200+
elog(ERROR,"Illegal class name '%s'"
201+
"\n\tThe 'pg_' name prefix is reserved for system catalogs",
202202
relname);
203203
}
204204

@@ -427,15 +427,15 @@ CheckAttributeNames(TupleDesc tupdesc)
427427
if (nameeq(&(HeapAtt[j]->attname),
428428
&(tupdesc->attrs[i]->attname)))
429429
{
430-
elog(ERROR,
431-
"create: system attribute named \"%s\"",
430+
elog(ERROR,"Attribute '%s' has a name conflict"
431+
"\n\tName matches an existing system attribute",
432432
HeapAtt[j]->attname.data);
433433
}
434434
}
435435
if (tupdesc->attrs[i]->atttypid==UNKNOWNOID)
436436
{
437-
elog(NOTICE,
438-
"create: attribute named \"%s\" has an unknown type",
437+
elog(NOTICE,"Attribute '%s' has an unknown type"
438+
"\n\tRelation created; continue",
439439
tupdesc->attrs[i]->attname.data);
440440
}
441441
}
@@ -451,8 +451,7 @@ CheckAttributeNames(TupleDesc tupdesc)
451451
if (nameeq(&(tupdesc->attrs[j]->attname),
452452
&(tupdesc->attrs[i]->attname)))
453453
{
454-
elog(ERROR,
455-
"create: repeated attribute \"%s\"",
454+
elog(ERROR,"Attribute '%s' is repeated",
456455
tupdesc->attrs[j]->attname.data);
457456
}
458457
}
@@ -774,15 +773,16 @@ heap_create_with_catalog(char *relname,
774773
*/
775774
Assert(IsNormalProcessingMode()||IsBootstrapProcessingMode());
776775
if (natts==0||natts>MaxHeapAttributeNumber)
777-
elog(ERROR,"amcreate: from 1 to %d attributes must be specified",
778-
MaxHeapAttributeNumber);
776+
elog(ERROR,"Number of attributes is out of range"
777+
"\n\tFrom 1 to %d attributes may be specified",
778+
MaxHeapAttributeNumber);
779779

780780
CheckAttributeNames(tupdesc);
781781

782782
/* temp tables can mask non-temp tables */
783783
if ((!istemp&&RelnameFindRelid(relname))||
784784
(istemp&&get_temp_rel_by_name(relname)!=NULL))
785-
elog(ERROR,"%s relation already exists",relname);
785+
elog(ERROR,"Relation '%s' already exists",relname);
786786

787787
/* invalidate cache so non-temp table is masked by temp */
788788
if (istemp)
@@ -951,7 +951,7 @@ RelationRemoveInheritance(Relation relation)
951951
heap_endscan(scan);
952952
heap_close(catalogRelation);
953953

954-
elog(ERROR,"relation <%d> inherits\"%s\"",
954+
elog(ERROR,"Relation '%d' inherits'%s'",
955955
((Form_pg_inherits)GETSTRUCT(tuple))->inhrel,
956956
RelationGetRelationName(relation));
957957
}
@@ -1054,7 +1054,7 @@ DeleteRelationTuple(Relation rel)
10541054
if (!HeapTupleIsValid(tup))
10551055
{
10561056
heap_close(pg_class_desc);
1057-
elog(ERROR,"DeleteRelationTuple: %s relation nonexistent",
1057+
elog(ERROR,"Relation '%s' does not exist",
10581058
&rel->rd_rel->relname);
10591059
}
10601060

@@ -1250,7 +1250,7 @@ heap_destroy_with_catalog(char *relname)
12501250
*/
12511251
rel=heap_openr(relname);
12521252
if (rel==NULL)
1253-
elog(ERROR,"Relation%s Does Not Exist!",relname);
1253+
elog(ERROR,"Relation'%s' does not exist",relname);
12541254

12551255
LockRelation(rel,AccessExclusiveLock);
12561256
rid=rel->rd_id;
@@ -1261,7 +1261,7 @@ heap_destroy_with_catalog(char *relname)
12611261
*/
12621262
/* allow temp of pg_class? Guess so. */
12631263
if (!istemp&&IsSystemRelationName(RelationGetRelationName(rel)->data))
1264-
elog(ERROR,"amdestroy: cannot destroy %s relation",
1264+
elog(ERROR,"System relation '%s' cannot be destroyed",
12651265
&rel->rd_rel->relname);
12661266

12671267
/* ----------------
@@ -1505,7 +1505,7 @@ start:;
15051505

15061506
if (length(query->rtable)>1||
15071507
flatten_tlist(query->targetList)!=NIL)
1508-
elog(ERROR,"DEFAULT: cannotuse attribute(s)");
1508+
elog(ERROR,"Cannotuse attribute(s) in DEFAULT clause");
15091509
te= (TargetEntry*)lfirst(query->targetList);
15101510
resdom=te->resdom;
15111511
expr=te->expr;
@@ -1585,7 +1585,7 @@ StoreRelCheck(Relation rel, ConstrCheck *check)
15851585
query= (Query*) (queryTree_list->qtrees[0]);
15861586

15871587
if (length(query->rtable)>1)
1588-
elog(ERROR,"CHECK: onlyrelation %.*s can be referenced",
1588+
elog(ERROR,"Onlyrelation'%.*s' can be referenced",
15891589
NAMEDATALEN,rel->rd_rel->relname.data);
15901590

15911591
plan= (Plan*)lfirst(planTree_list);

‎src/backend/parser/parse_relation.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.18 1999/02/21 03:49:03 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.19 1999/02/23 07:53:01 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -157,7 +157,7 @@ colnameRangeTableEntry(ParseState *pstate, char *colname)
157157
{
158158
if (!pstate->p_is_insert||
159159
rte!=pstate->p_target_rangetblentry)
160-
elog(ERROR,"Column%s is ambiguous",colname);
160+
elog(ERROR,"Column'%s' is ambiguous",colname);
161161
}
162162
else
163163
rte_result=rte;
@@ -198,7 +198,7 @@ addRangeTableEntry(ParseState *pstate,
198198

199199
return (RangeTblEntry*)nth(rt_index-1,pstate->p_rtable);
200200
}
201-
elog(ERROR,"Table name%s specified more than once",refname);
201+
elog(ERROR,"Table name'%s' specified more than once",refname);
202202
}
203203
}
204204

@@ -317,7 +317,7 @@ attnameAttNum(Relation rd, char *a)
317317
returnspecial_attr[i].code;
318318

319319
/* on failure */
320-
elog(ERROR,"Relation%s does not have attribute%s",
320+
elog(ERROR,"Relation'%s' does not have attribute'%s'",
321321
RelationGetRelationName(rd),a);
322322
return0;/* lint */
323323
}
@@ -396,7 +396,7 @@ handleTargetColname(ParseState *pstate, char **resname,
396396
pstate->p_insert_columns=lnext(pstate->p_insert_columns);
397397
}
398398
else
399-
elog(ERROR,"insert: more expressions than target columns");
399+
elog(ERROR,"INSERT has more expressions than target columns");
400400
}
401401
if (pstate->p_is_insert||pstate->p_is_update)
402402
checkTargetTypes(pstate,*resname,refname,colname);
@@ -424,13 +424,13 @@ checkTargetTypes(ParseState *pstate, char *target_colname,
424424
{
425425
rte=colnameRangeTableEntry(pstate,colname);
426426
if (rte== (RangeTblEntry*)NULL)
427-
elog(ERROR,"attribute %s not found",colname);
427+
elog(ERROR,"Attribute %s not found",colname);
428428
refname=rte->refname;
429429
}
430430

431431
/*
432432
if (pstate->p_is_insert && rte == pstate->p_target_rangetblentry)
433-
elog(ERROR, "%s not available in this context", colname);
433+
elog(ERROR, "'%s' not available in this context", colname);
434434
*/
435435
resdomno_id=get_attnum(rte->relid,colname);
436436
attrtype_id=get_atttype(rte->relid,resdomno_id);
@@ -460,18 +460,18 @@ checkTargetTypes(ParseState *pstate, char *target_colname,
460460
}
461461
#else
462462
if (attrtype_id!=attrtype_target)
463-
elog(ERROR,"Type of%s does not match target column%s",
463+
elog(ERROR,"Type of'%s' does not match target column'%s'",
464464
colname,target_colname);
465465

466466
if (attrtype_id==BPCHAROID&&
467467
get_atttypmod(rte->relid,resdomno_id)!=
468468
get_atttypmod(pstate->p_target_relation->rd_id,resdomno_target))
469-
elog(ERROR,"Length of%s is not equal to the length of target column%s",
469+
elog(ERROR,"Length of'%s' is not equal to the length of target column'%s'",
470470
colname,target_colname);
471471
if (attrtype_id==VARCHAROID&&
472472
get_atttypmod(rte->relid,resdomno_id)>
473473
get_atttypmod(pstate->p_target_relation->rd_id,resdomno_target))
474-
elog(ERROR,"Length of%s is longer than length of target column%s",
474+
elog(ERROR,"Length of'%s' is longer than length of target column'%s'",
475475
colname,target_colname);
476476
#endif
477477
}

‎src/backend/parser/parse_type.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.18 1998/11/27 19:52:14 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.19 1999/02/23 07:53:01 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -51,7 +51,7 @@ typeidTypeName(Oid id)
5151
ObjectIdGetDatum(id),
5252
0,0,0)))
5353
{
54-
elog(ERROR,"type id lookup of%ufailed",id);
54+
elog(ERROR,"Unable to locate type oid%uin catalog",id);
5555
returnNULL;
5656
}
5757
typetuple= (Form_pg_type)GETSTRUCT(tup);
@@ -68,7 +68,7 @@ typeidType(Oid id)
6868
ObjectIdGetDatum(id),
6969
0,0,0)))
7070
{
71-
elog(ERROR,"type id lookup of%ufailed",id);
71+
elog(ERROR,"Unable to locate type oid%uin catalog",id);
7272
returnNULL;
7373
}
7474
return (Type)tup;
@@ -86,7 +86,7 @@ typenameType(char *s)
8686
if (!(tup=SearchSysCacheTuple(TYPNAME,
8787
PointerGetDatum(s),
8888
0,0,0)))
89-
elog(ERROR,"type name lookup of %s failed",s);
89+
elog(ERROR,"Unable to locate type name '%s' in catalog",s);
9090
return (Type)tup;
9191
}
9292

@@ -217,7 +217,7 @@ typeidTypElem(Oid type_id)
217217
returntype->typelem;
218218
}
219219

220-
/* Given the attribute type of an array return thearrtribute type of
220+
/* Given the attribute type of an array return theattribute type of
221221
an element of the array */
222222

223223
Oid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp