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

Commit5db837d

Browse files
committed
Message improvements
1 parent53264c7 commit5db837d

File tree

26 files changed

+78
-82
lines changed

26 files changed

+78
-82
lines changed

‎src/backend/access/transam/parallel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -907,12 +907,12 @@ ParallelWorkerMain(Datum main_arg)
907907
if (seg==NULL)
908908
ereport(ERROR,
909909
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
910-
errmsg("unable to map dynamic shared memory segment")));
910+
errmsg("could not map dynamic shared memory segment")));
911911
toc=shm_toc_attach(PARALLEL_MAGIC,dsm_segment_address(seg));
912912
if (toc==NULL)
913913
ereport(ERROR,
914914
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
915-
errmsg("bad magic number in dynamic shared memory segment")));
915+
errmsg("invalid magic number in dynamic shared memory segment")));
916916

917917
/* Look up fixed parallel state. */
918918
fps=shm_toc_lookup(toc,PARALLEL_KEY_FIXED);
@@ -1063,7 +1063,7 @@ ParallelExtensionTrampoline(dsm_segment *seg, shm_toc *toc)
10631063
staticvoid
10641064
ParallelErrorContext(void*arg)
10651065
{
1066-
errcontext("parallel worker,pid %d",*(int32*)arg);
1066+
errcontext("parallel worker,PID %d",*(int32*)arg);
10671067
}
10681068

10691069
/*

‎src/backend/access/transam/xlog.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4976,9 +4976,10 @@ readRecoveryCommandFile(void)
49764976
else
49774977
ereport(ERROR,
49784978
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
4979-
errmsg("invalid value for recovery parameter \"%s\"",
4980-
"recovery_target_action"),
4981-
errhint("The allowed values are \"pause\", \"promote\", and \"shutdown\".")));
4979+
errmsg("invalid value for recovery parameter \"%s\": \"%s\"",
4980+
"recovery_target_action",
4981+
item->value),
4982+
errhint("Valid values are \"pause\", \"promote\", and \"shutdown\".")));
49824983

49834984
ereport(DEBUG2,
49844985
(errmsg_internal("recovery_target_action = '%s'",
@@ -5058,7 +5059,9 @@ readRecoveryCommandFile(void)
50585059
else
50595060
ereport(ERROR,
50605061
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5061-
errmsg("invalid value for recovery parameter \"recovery_target\""),
5062+
errmsg("invalid value for recovery parameter \"%s\": \"%s\"",
5063+
"recovery_target",
5064+
item->value),
50625065
errhint("The only allowed value is \"immediate\".")));
50635066
ereport(DEBUG2,
50645067
(errmsg_internal("recovery_target = '%s'",
@@ -6142,15 +6145,15 @@ StartupXLOG(void)
61426145
unlink(TABLESPACE_MAP_OLD);
61436146
if (rename(TABLESPACE_MAP,TABLESPACE_MAP_OLD)==0)
61446147
ereport(LOG,
6145-
(errmsg("ignoring \"%s\"filebecause no \"%s\" file exists",
6148+
(errmsg("ignoringfile\"%s\" because nofile\"%s\" exists",
61466149
TABLESPACE_MAP,BACKUP_LABEL_FILE),
61476150
errdetail("File \"%s\" was renamed to \"%s\".",
61486151
TABLESPACE_MAP,TABLESPACE_MAP_OLD)));
61496152
else
61506153
ereport(LOG,
61516154
(errmsg("ignoring \"%s\" file because no \"%s\" file exists",
61526155
TABLESPACE_MAP,BACKUP_LABEL_FILE),
6153-
errdetail("File\"%s\" could not be renamed to \"%s\": %m.",
6156+
errdetail("Could not rename file\"%s\" to \"%s\": %m.",
61546157
TABLESPACE_MAP,TABLESPACE_MAP_OLD)));
61556158
}
61566159

@@ -6281,24 +6284,24 @@ StartupXLOG(void)
62816284
LastRec=RecPtr=checkPointLoc;
62826285

62836286
ereport(DEBUG1,
6284-
(errmsg("redo record is at %X/%X; shutdown %s",
6287+
(errmsg_internal("redo record is at %X/%X; shutdown %s",
62856288
(uint32) (checkPoint.redo >>32), (uint32)checkPoint.redo,
62866289
wasShutdown ?"TRUE" :"FALSE")));
62876290
ereport(DEBUG1,
6288-
(errmsg("next transaction ID: %u/%u; next OID: %u",
6291+
(errmsg_internal("next transaction ID: %u/%u; next OID: %u",
62896292
checkPoint.nextXidEpoch,checkPoint.nextXid,
62906293
checkPoint.nextOid)));
62916294
ereport(DEBUG1,
6292-
(errmsg("next MultiXactId: %u; next MultiXactOffset: %u",
6295+
(errmsg_internal("next MultiXactId: %u; next MultiXactOffset: %u",
62936296
checkPoint.nextMulti,checkPoint.nextMultiOffset)));
62946297
ereport(DEBUG1,
6295-
(errmsg("oldest unfrozen transaction ID: %u, in database %u",
6298+
(errmsg_internal("oldest unfrozen transaction ID: %u, in database %u",
62966299
checkPoint.oldestXid,checkPoint.oldestXidDB)));
62976300
ereport(DEBUG1,
6298-
(errmsg("oldest MultiXactId: %u, in database %u",
6301+
(errmsg_internal("oldest MultiXactId: %u, in database %u",
62996302
checkPoint.oldestMulti,checkPoint.oldestMultiDB)));
63006303
ereport(DEBUG1,
6301-
(errmsg("commit timestamp Xid oldest/newest: %u/%u",
6304+
(errmsg_internal("commit timestamp Xid oldest/newest: %u/%u",
63026305
checkPoint.oldestCommitTs,
63036306
checkPoint.newestCommitTs)));
63046307
if (!TransactionIdIsNormal(checkPoint.nextXid))

‎src/backend/catalog/objectaddress.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
16521652
if (!missing_ok)
16531653
ereport(ERROR,
16541654
(errcode(ERRCODE_UNDEFINED_OBJECT),
1655-
errmsg("user mapping for user \"%s\"in server \"%s\" does not exist",
1655+
errmsg("user mapping for user \"%s\"on server \"%s\" does not exist",
16561656
username,servername)));
16571657
returnaddress;
16581658
}
@@ -1678,7 +1678,7 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
16781678
if (!missing_ok)
16791679
ereport(ERROR,
16801680
(errcode(ERRCODE_UNDEFINED_OBJECT),
1681-
errmsg("user mapping for user \"%s\"in server \"%s\" does not exist",
1681+
errmsg("user mapping for user \"%s\"on server \"%s\" does not exist",
16821682
username,servername)));
16831683
returnaddress;
16841684
}

‎src/backend/commands/copy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
874874
if (is_from)
875875
ereport(ERROR,
876876
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
877-
errmsg("COPY FROM not supported with rowlevel security."),
877+
errmsg("COPY FROM not supported with row-level security."),
878878
errhint("Use INSERT statements instead.")));
879879

880880
/* Build target list */

‎src/backend/commands/extension.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3111,7 +3111,7 @@ read_whole_file(const char *filename, int *length)
31113111
if (fst.st_size> (MaxAllocSize-1))
31123112
ereport(ERROR,
31133113
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
3114-
errmsg("file too large")));
3114+
errmsg("file\"%s\" istoo large",filename)));
31153115
bytes_to_read= (size_t)fst.st_size;
31163116

31173117
if ((file=AllocateFile(filename,PG_BINARY_R))==NULL)

‎src/backend/commands/tablecmds.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11213,10 +11213,8 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
1121311213
caseRELPERSISTENCE_TEMP:
1121411214
ereport(ERROR,
1121511215
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
11216-
errmsg("cannot change logged status of table%s",
11216+
errmsg("cannot change logged status of table\"%s\" because it is temporary",
1121711217
RelationGetRelationName(rel)),
11218-
errdetail("Table %s is temporary.",
11219-
RelationGetRelationName(rel)),
1122011218
errtable(rel)));
1122111219
break;
1122211220
caseRELPERSISTENCE_PERMANENT:
@@ -11274,23 +11272,19 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
1127411272
if (foreignrel->rd_rel->relpersistence!=RELPERSISTENCE_PERMANENT)
1127511273
ereport(ERROR,
1127611274
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
11277-
errmsg("cannot change status of table %s to logged",
11278-
RelationGetRelationName(rel)),
11279-
errdetail("Table %s references unlogged table %s.",
11280-
RelationGetRelationName(rel),
11281-
RelationGetRelationName(foreignrel)),
11275+
errmsg("could not change table \"%s\" to logged because it references unlogged table \"%s\"",
11276+
RelationGetRelationName(rel),
11277+
RelationGetRelationName(foreignrel)),
1128211278
errtableconstraint(rel,NameStr(con->conname))));
1128311279
}
1128411280
else
1128511281
{
1128611282
if (foreignrel->rd_rel->relpersistence==RELPERSISTENCE_PERMANENT)
1128711283
ereport(ERROR,
1128811284
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
11289-
errmsg("cannot change status of table %s to unlogged",
11290-
RelationGetRelationName(rel)),
11291-
errdetail("Logged table %s is referenced by table %s.",
11292-
RelationGetRelationName(foreignrel),
11293-
RelationGetRelationName(rel)),
11285+
errmsg("could not change table \"%s\" to unlogged because it references logged table \"%s\"",
11286+
RelationGetRelationName(rel),
11287+
RelationGetRelationName(foreignrel)),
1129411288
errtableconstraint(rel,NameStr(con->conname))));
1129511289
}
1129611290

‎src/backend/commands/tablespace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ destroy_tablespace_directories(Oid tablespaceoid, bool redo)
800800
/* Refuse to remove anything that's not a directory or symlink */
801801
ereport(redo ?LOG :ERROR,
802802
(ERRCODE_SYSTEM_ERROR,
803-
errmsg("not a directory or symbolic link: \"%s\"",
803+
errmsg("\"%s\" isnot a directory or symbolic link",
804804
linkloc)));
805805
}
806806

@@ -886,7 +886,7 @@ remove_tablespace_symlink(const char *linkloc)
886886
{
887887
/* Refuse to remove anything that's not a directory or symlink */
888888
ereport(ERROR,
889-
(errmsg("not a directory or symbolic link: \"%s\"",
889+
(errmsg("\"%s\" isnot a directory or symbolic link",
890890
linkloc)));
891891
}
892892
}

‎src/backend/libpq/auth.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,7 @@ recv_password_packet(Port *port)
668668
errmsg("invalid password packet size")));
669669

670670
/* Do not echo password to logs, for security. */
671-
ereport(DEBUG5,
672-
(errmsg("received password packet")));
671+
elog(DEBUG5,"received password packet");
673672

674673
/*
675674
* Return the received string. Note we do not attempt to do any

‎src/backend/libpq/pqcomm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ pq_startmsgread(void)
11681168
if (PqCommReadingMsg)
11691169
ereport(FATAL,
11701170
(errcode(ERRCODE_PROTOCOL_VIOLATION),
1171-
errmsg("terminating connection because protocolsync was lost")));
1171+
errmsg("terminating connection because protocolsynchronization was lost")));
11721172

11731173
PqCommReadingMsg= true;
11741174
}

‎src/backend/parser/parse_agg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ parseCheckAggregates(ParseState *pstate, Query *qry)
979979
if (!gsets)
980980
ereport(ERROR,
981981
(errcode(ERRCODE_STATEMENT_TOO_COMPLEX),
982-
errmsg("too many grouping sets present (max 4096)"),
982+
errmsg("too many grouping sets present (maximum 4096)"),
983983
parser_errposition(pstate,
984984
qry->groupClause
985985
?exprLocation((Node*)qry->groupClause)

‎src/backend/parser/parse_clause.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2856,7 +2856,7 @@ transformOnConflictArbiter(ParseState *pstate,
28562856
ereport(ERROR,
28572857
(errcode(ERRCODE_SYNTAX_ERROR),
28582858
errmsg("ON CONFLICT DO UPDATE requires inference specification or constraint name"),
2859-
errhint("For example, ON CONFLICT (<column>)."),
2859+
errhint("For example, ON CONFLICT (column_name)."),
28602860
parser_errposition(pstate,
28612861
exprLocation((Node*)onConflictClause))));
28622862

‎src/backend/parser/parse_relation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3080,7 +3080,7 @@ errorMissingColumn(ParseState *pstate,
30803080
errmsg("column %s.%s does not exist",relname,colname) :
30813081
errmsg("column \"%s\" does not exist",colname),
30823082
state->rfirst ?closestfirst ?
3083-
errhint("Perhaps you meant to reference the column \"%s\".\"%s\".",
3083+
errhint("Perhaps you meant to reference the column \"%s.%s\".",
30843084
state->rfirst->eref->aliasname,closestfirst) :
30853085
errhint("There is a column named \"%s\" in table \"%s\", but it cannot be referenced from this part of the query.",
30863086
colname,state->rfirst->eref->aliasname) :0,
@@ -3099,7 +3099,7 @@ errorMissingColumn(ParseState *pstate,
30993099
relname ?
31003100
errmsg("column %s.%s does not exist",relname,colname) :
31013101
errmsg("column \"%s\" does not exist",colname),
3102-
errhint("Perhaps you meant to reference the column \"%s\".\"%s\" or the column \"%s\".\"%s\".",
3102+
errhint("Perhaps you meant to reference the column \"%s.%s\" or the column \"%s.%s\".",
31033103
state->rfirst->eref->aliasname,closestfirst,
31043104
state->rsecond->eref->aliasname,closestsecond),
31053105
parser_errposition(pstate,location)));

‎src/backend/postmaster/postmaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,8 +2047,10 @@ ProcessStartupPacket(Port *port, bool SSLdone)
20472047
elseif (!parse_bool(valptr,&am_walsender))
20482048
ereport(FATAL,
20492049
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2050-
errmsg("invalid value for parameter \"replication\""),
2051-
errhint("Valid values are: false, 0, true, 1, database.")));
2050+
errmsg("invalid value for parameter \"%s\": \"%s\"",
2051+
"replication",
2052+
valptr),
2053+
errhint("Valid values are: \"false\", 0, \"true\", 1, \"database\".")));
20522054
}
20532055
else
20542056
{

‎src/backend/storage/lmgr/lwlock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ PRINT_LWDEBUG(const char *where, LWLock *lock, LWLockMode mode)
184184
ereport(LOG,
185185
(errhidestmt(true),
186186
errhidecontext(true),
187-
errmsg("%d: %s(%s): excl %u shared %u haswaiters %u waiters %u rOK %d",
187+
errmsg_internal("%d: %s(%s): excl %u shared %u haswaiters %u waiters %u rOK %d",
188188
MyProcPid,
189189
where,MainLWLockNames[id],
190190
!!(state&LW_VAL_EXCLUSIVE),
@@ -196,7 +196,7 @@ PRINT_LWDEBUG(const char *where, LWLock *lock, LWLockMode mode)
196196
ereport(LOG,
197197
(errhidestmt(true),
198198
errhidecontext(true),
199-
errmsg("%d: %s(%s %d): excl %u shared %u haswaiters %u waiters %u rOK %d",
199+
errmsg_internal("%d: %s(%s %d): excl %u shared %u haswaiters %u waiters %u rOK %d",
200200
MyProcPid,
201201
where,T_NAME(lock),id,
202202
!!(state&LW_VAL_EXCLUSIVE),
@@ -219,13 +219,13 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg)
219219
ereport(LOG,
220220
(errhidestmt(true),
221221
errhidecontext(true),
222-
errmsg("%s(%s): %s",where,
222+
errmsg_internal("%s(%s): %s",where,
223223
MainLWLockNames[id],msg)));
224224
else
225225
ereport(LOG,
226226
(errhidestmt(true),
227227
errhidecontext(true),
228-
errmsg("%s(%s %d): %s",where,
228+
errmsg_internal("%s(%s %d): %s",where,
229229
T_NAME(lock),id,msg)));
230230
}
231231
}

‎src/backend/utils/adt/array_userfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ array_position_common(FunctionCallInfo fcinfo)
746746
if (PG_ARGISNULL(2))
747747
ereport(ERROR,
748748
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
749-
errmsg("initial positionshould not beNULL")));
749+
errmsg("initial positionmust not benull")));
750750

751751
position_min=PG_GETARG_INT32(2);
752752
}

‎src/backend/utils/adt/encode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ b64_decode(const char *src, unsigned len, char *dst)
304304
if (b<0)
305305
ereport(ERROR,
306306
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
307-
errmsg("invalid symbol'%c' while decoding base64 sequence", (int)c)));
307+
errmsg("invalid symbol\"%c\" while decoding base64 sequence", (int)c)));
308308
}
309309
/* add it to buffer */
310310
buf= (buf <<6)+b;
@@ -325,7 +325,7 @@ b64_decode(const char *src, unsigned len, char *dst)
325325
ereport(ERROR,
326326
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
327327
errmsg("invalid base64 end sequence"),
328-
errhint("Input data is missing padding, truncated, or otherwise corrupted.")));
328+
errhint("Input data is missing padding,istruncated, or is otherwise corrupted.")));
329329

330330
returnp-dst;
331331
}

‎src/backend/utils/adt/jsonb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
11791179
if (nargs %2!=0)
11801180
ereport(ERROR,
11811181
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1182-
errmsg("invalid numberor arguments: object must be matched key value pairs")));
1182+
errmsg("invalid numberof arguments: object must be matched key value pairs")));
11831183

11841184
memset(&result,0,sizeof(JsonbInState));
11851185

@@ -1193,7 +1193,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
11931193
if (PG_ARGISNULL(i))
11941194
ereport(ERROR,
11951195
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1196-
errmsg("arg %d: keycannot be null",i+1)));
1196+
errmsg("argument %d: keymust not be null",i+1)));
11971197
val_type=get_fn_expr_argtype(fcinfo->flinfo,i);
11981198

11991199
/*
@@ -1215,7 +1215,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
12151215
if (val_type==InvalidOid||val_type==UNKNOWNOID)
12161216
ereport(ERROR,
12171217
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1218-
errmsg("arg %d: could not determine data type",i+1)));
1218+
errmsg("argument %d: could not determine data type",i+1)));
12191219

12201220
add_jsonb(arg, false,&result,val_type, true);
12211221

‎src/backend/utils/misc/guc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ static struct config_int ConfigureNamesInt[] =
24612461

24622462
{
24632463
{"wal_retrieve_retry_interval",PGC_SIGHUP,REPLICATION_STANDBY,
2464-
gettext_noop("Sets the time to wait before retrying to retrieve WAL"
2464+
gettext_noop("Sets the time to wait before retrying to retrieve WAL"
24652465
"after a failed attempt."),
24662466
NULL,
24672467
GUC_UNIT_MS
@@ -2589,7 +2589,7 @@ static struct config_int ConfigureNamesInt[] =
25892589

25902590
{
25912591
{"ssl_renegotiation_limit",PGC_USERSET,CONN_AUTH_SECURITY,
2592-
gettext_noop("SSL regenotiation is no longer supported; this can only be 0"),
2592+
gettext_noop("SSL regenotiation is no longer supported; this can only be 0."),
25932593
NULL,
25942594
GUC_NO_SHOW_ALL |GUC_NOT_IN_SAMPLE |GUC_DISALLOW_IN_FILE,
25952595
},
@@ -3417,7 +3417,7 @@ static struct config_string ConfigureNamesString[] =
34173417

34183418
{
34193419
{"cluster_name",PGC_POSTMASTER,PROCESS_TITLE,
3420-
gettext_noop("Sets the name of the cluster which is included in the process title."),
3420+
gettext_noop("Sets the name of the cluster, which is included in the process title."),
34213421
NULL,
34223422
GUC_IS_NAME
34233423
},

‎src/backend/utils/misc/rls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ check_enable_rls(Oid relid, Oid checkAsUser, bool noError)
122122
if (!row_security&& !noError)
123123
ereport(ERROR,
124124
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
125-
errmsg("insufficient privilege to bypass row security.")));
125+
errmsg("insufficient privilege to bypass row-level security")));
126126

127127
/* RLS should be fully enabled for this relation. */
128128
returnRLS_ENABLED;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp