Skip to content

Commit c318337

Browse files
committed
Message style improvements
1 parent ee3fdb8 commit c318337

File tree

11 files changed

+33
-29
lines changed

11 files changed

+33
-29
lines changed

src/backend/access/common/toast_compression.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int default_toast_compression = TOAST_PGLZ_COMPRESSION;
2929
#define NO_LZ4_SUPPORT() \
3030
ereport(ERROR, \
3131
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
32-
errmsg("unsupported LZ4 compression method"), \
32+
errmsg("compression method lz4 not supported"), \
3333
errdetail("This functionality requires the server to be built with lz4 support."), \
3434
errhint("You need to rebuild PostgreSQL using %s.", "--with-lz4")))
3535

src/backend/catalog/catalog.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,12 @@ GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
375375
if (retries >= retries_before_log)
376376
{
377377
ereport(LOG,
378-
(errmsg("still finding an unused OID within relation \"%s\"",
378+
(errmsg("still searching for an unused OID in relation \"%s\"",
379379
RelationGetRelationName(relation)),
380-
errdetail("OID candidates were checked \"%llu\" times, but no unused OID is yet found.",
381-
(unsigned long long) retries)));
380+
errdetail_plural("OID candidates have been checked %llu time, but no unused OID has been found yet.",
381+
"OID candidates have been checked %llu times, but no unused OID has been found yet.",
382+
retries,
383+
(unsigned long long) retries)));
382384

383385
/*
384386
* Double the number of retries to do before logging next until it
@@ -400,8 +402,10 @@ GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
400402
if (retries > GETNEWOID_LOG_THRESHOLD)
401403
{
402404
ereport(LOG,
403-
(errmsg("new OID has been assigned in relation \"%s\" after \"%llu\" retries",
404-
RelationGetRelationName(relation), (unsigned long long) retries)));
405+
(errmsg_plural("new OID has been assigned in relation \"%s\" after %llu retry",
406+
"new OID has been assigned in relation \"%s\" after %llu retries",
407+
retries,
408+
RelationGetRelationName(relation), (unsigned long long) retries)));
405409
}
406410

407411
return newOid;

src/backend/catalog/pg_inherits.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool expect_detach_pending,
593593
errmsg("cannot detach partition \"%s\"",
594594
childname ? childname : "unknown relation"),
595595
errdetail("The partition is being detached concurrently or has an unfinished detach."),
596-
errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the pending detach operation")));
596+
errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the pending detach operation.")));
597597
if (!detach_pending && expect_detach_pending)
598598
ereport(ERROR,
599599
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),

src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14773,7 +14773,7 @@ MarkInheritDetached(Relation child_rel, Relation parent_rel)
1477314773
get_rel_name(inhForm->inhrelid),
1477414774
get_namespace_name(parent_rel->rd_rel->relnamespace),
1477514775
RelationGetRelationName(parent_rel)),
14776-
errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the detach operation."));
14776+
errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the pending detach operation."));
1477714777

1477814778
if (inhForm->inhrelid == RelationGetRelid(child_rel))
1477914779
{

src/backend/postmaster/pgstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ pgstat_reset_shared_counters(const char *target)
14571457
ereport(ERROR,
14581458
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
14591459
errmsg("unrecognized reset target: \"%s\"", target),
1460-
errhint("Target must be \"archiver\", \"bgwriter\" or \"wal\".")));
1460+
errhint("Target must be \"archiver\", \"bgwriter\", or \"wal\".")));
14611461

14621462
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_RESETSHAREDCOUNTER);
14631463
pgstat_send(&msg, sizeof(msg));

src/backend/storage/file/fd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3295,13 +3295,13 @@ do_syncfs(const char *path)
32953295
{
32963296
ereport(LOG,
32973297
(errcode_for_file_access(),
3298-
errmsg("could not open %s: %m", path)));
3298+
errmsg("could not open file \"%s\": %m", path)));
32993299
return;
33003300
}
33013301
if (syncfs(fd) < 0)
33023302
ereport(LOG,
33033303
(errcode_for_file_access(),
3304-
errmsg("could not sync filesystem for \"%s\": %m", path)));
3304+
errmsg("could not synchronize file system for file \"%s\": %m", path)));
33053305
CloseTransientFile(fd);
33063306
}
33073307
#endif

src/backend/storage/ipc/standby.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
303303
{
304304
ereport(LOG,
305305
errmsg("recovery still waiting after %ld.%03d ms: %s",
306-
msecs, usecs, _(get_recovery_conflict_desc(reason))),
306+
msecs, usecs, get_recovery_conflict_desc(reason)),
307307
nprocs > 0 ? errdetail_log_plural("Conflicting process: %s.",
308308
"Conflicting processes: %s.",
309309
nprocs, buf.data) : 0);
@@ -312,7 +312,7 @@ LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
312312
{
313313
ereport(LOG,
314314
errmsg("recovery finished waiting after %ld.%03d ms: %s",
315-
msecs, usecs, _(get_recovery_conflict_desc(reason))));
315+
msecs, usecs, get_recovery_conflict_desc(reason)));
316316
}
317317

318318
if (nprocs > 0)
@@ -1418,27 +1418,27 @@ LogStandbyInvalidations(int nmsgs, SharedInvalidationMessage *msgs,
14181418
static const char *
14191419
get_recovery_conflict_desc(ProcSignalReason reason)
14201420
{
1421-
const char *reasonDesc = gettext_noop("unknown reason");
1421+
const char *reasonDesc = _("unknown reason");
14221422

14231423
switch (reason)
14241424
{
14251425
case PROCSIG_RECOVERY_CONFLICT_BUFFERPIN:
1426-
reasonDesc = gettext_noop("recovery conflict on buffer pin");
1426+
reasonDesc = _("recovery conflict on buffer pin");
14271427
break;
14281428
case PROCSIG_RECOVERY_CONFLICT_LOCK:
1429-
reasonDesc = gettext_noop("recovery conflict on lock");
1429+
reasonDesc = _("recovery conflict on lock");
14301430
break;
14311431
case PROCSIG_RECOVERY_CONFLICT_TABLESPACE:
1432-
reasonDesc = gettext_noop("recovery conflict on tablespace");
1432+
reasonDesc = _("recovery conflict on tablespace");
14331433
break;
14341434
case PROCSIG_RECOVERY_CONFLICT_SNAPSHOT:
1435-
reasonDesc = gettext_noop("recovery conflict on snapshot");
1435+
reasonDesc = _("recovery conflict on snapshot");
14361436
break;
14371437
case PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK:
1438-
reasonDesc = gettext_noop("recovery conflict on buffer deadlock");
1438+
reasonDesc = _("recovery conflict on buffer deadlock");
14391439
break;
14401440
case PROCSIG_RECOVERY_CONFLICT_DATABASE:
1441-
reasonDesc = gettext_noop("recovery conflict on database");
1441+
reasonDesc = _("recovery conflict on database");
14421442
break;
14431443
default:
14441444
break;

src/backend/tcop/fastpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fetch_fp_info(Oid func_id, struct fp_info *fip)
145145
if (pp->prokind != PROKIND_FUNCTION || pp->proretset)
146146
ereport(ERROR,
147147
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
148-
errmsg("cannot call function %s via fastpath interface",
148+
errmsg("cannot call function \"%s\" via fastpath interface",
149149
NameStr(pp->proname))));
150150

151151
/* watch out for catalog entries with more than FUNC_MAX_ARGS args */

src/backend/utils/adt/multirangetypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ multirange_in(PG_FUNCTION_ARGS)
282282
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
283283
errmsg("malformed multirange literal: \"%s\"",
284284
input_str),
285-
errdetail("Junk after right brace.")));
285+
errdetail("Junk after closing right brace.")));
286286

287287
ret = make_multirange(mltrngtypoid, rangetyp, range_count, ranges);
288288
PG_RETURN_MULTIRANGE_P(ret);
@@ -968,7 +968,7 @@ multirange_constructor2(PG_FUNCTION_ARGS)
968968
if (dims > 1)
969969
ereport(ERROR,
970970
(errcode(ERRCODE_CARDINALITY_VIOLATION),
971-
errmsg("multiranges cannot be constructed from multi-dimensional arrays")));
971+
errmsg("multiranges cannot be constructed from multidimensional arrays")));
972972

973973
rngtypid = ARR_ELEMTYPE(rangeArray);
974974
if (rngtypid != rangetyp->type_id)

src/test/regress/expected/compression_1.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Indexes:
1414
"idx" btree (f1)
1515

1616
CREATE TABLE cmdata1(f1 TEXT COMPRESSION lz4);
17-
ERROR: unsupported LZ4 compression method
17+
ERROR: compression method lz4 not supported
1818
DETAIL: This functionality requires the server to be built with lz4 support.
1919
HINT: You need to rebuild PostgreSQL using --with-lz4.
2020
INSERT INTO cmdata1 VALUES(repeat('1234567890', 1004));
@@ -193,7 +193,7 @@ LINE 1: SELECT pg_column_compression(x) FROM compressmv;
193193
^
194194
-- test compression with partition
195195
CREATE TABLE cmpart(f1 text COMPRESSION lz4) PARTITION BY HASH(f1);
196-
ERROR: unsupported LZ4 compression method
196+
ERROR: compression method lz4 not supported
197197
DETAIL: This functionality requires the server to be built with lz4 support.
198198
HINT: You need to rebuild PostgreSQL using --with-lz4.
199199
CREATE TABLE cmpart1 PARTITION OF cmpart FOR VALUES WITH (MODULUS 2, REMAINDER 0);
@@ -238,7 +238,7 @@ HINT: Available values: pglz.
238238
SET default_toast_compression = 'pglz';
239239
-- test alter compression method
240240
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
241-
ERROR: unsupported LZ4 compression method
241+
ERROR: compression method lz4 not supported
242242
DETAIL: This functionality requires the server to be built with lz4 support.
243243
HINT: You need to rebuild PostgreSQL using --with-lz4.
244244
INSERT INTO cmdata VALUES (repeat('123456789', 4004));
@@ -272,7 +272,7 @@ ERROR: relation "compressmv" does not exist
272272
ALTER TABLE cmpart1 ALTER COLUMN f1 SET COMPRESSION pglz;
273273
ERROR: relation "cmpart1" does not exist
274274
ALTER TABLE cmpart2 ALTER COLUMN f1 SET COMPRESSION lz4;
275-
ERROR: unsupported LZ4 compression method
275+
ERROR: compression method lz4 not supported
276276
DETAIL: This functionality requires the server to be built with lz4 support.
277277
HINT: You need to rebuild PostgreSQL using --with-lz4.
278278
-- new data should be compressed with the current compression method
@@ -312,7 +312,7 @@ SELECT pg_column_compression(f1) FROM cmdata;
312312
-- test expression index
313313
DROP TABLE cmdata2;
314314
CREATE TABLE cmdata2 (f1 TEXT COMPRESSION pglz, f2 TEXT COMPRESSION lz4);
315-
ERROR: unsupported LZ4 compression method
315+
ERROR: compression method lz4 not supported
316316
DETAIL: This functionality requires the server to be built with lz4 support.
317317
HINT: You need to rebuild PostgreSQL using --with-lz4.
318318
CREATE UNIQUE INDEX idx1 ON cmdata2 ((f1 || f2));

src/test/regress/expected/multirangetypes.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ select '{(,)}.'::textmultirange;
1717
ERROR: malformed multirange literal: "{(,)}."
1818
LINE 1: select '{(,)}.'::textmultirange;
1919
^
20-
DETAIL: Junk after right brace.
20+
DETAIL: Junk after closing right brace.
2121
select '{[a,c),}'::textmultirange;
2222
ERROR: malformed multirange literal: "{[a,c),}"
2323
LINE 1: select '{[a,c),}'::textmultirange;

0 commit comments

Comments
 (0)