Commit c3183377 authored by Peter Eisentraut's avatar Peter Eisentraut

Message style improvements

parent ee3fdb8f
...@@ -29,7 +29,7 @@ int default_toast_compression = TOAST_PGLZ_COMPRESSION; ...@@ -29,7 +29,7 @@ int default_toast_compression = TOAST_PGLZ_COMPRESSION;
#define NO_LZ4_SUPPORT() \ #define NO_LZ4_SUPPORT() \
ereport(ERROR, \ ereport(ERROR, \
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
errmsg("unsupported LZ4 compression method"), \ errmsg("compression method lz4 not supported"), \
errdetail("This functionality requires the server to be built with lz4 support."), \ errdetail("This functionality requires the server to be built with lz4 support."), \
errhint("You need to rebuild PostgreSQL using %s.", "--with-lz4"))) errhint("You need to rebuild PostgreSQL using %s.", "--with-lz4")))
......
...@@ -375,10 +375,12 @@ GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn) ...@@ -375,10 +375,12 @@ GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
if (retries >= retries_before_log) if (retries >= retries_before_log)
{ {
ereport(LOG, ereport(LOG,
(errmsg("still finding an unused OID within relation \"%s\"", (errmsg("still searching for an unused OID in relation \"%s\"",
RelationGetRelationName(relation)), RelationGetRelationName(relation)),
errdetail("OID candidates were checked \"%llu\" times, but no unused OID is yet found.", errdetail_plural("OID candidates have been checked %llu time, but no unused OID has been found yet.",
(unsigned long long) retries))); "OID candidates have been checked %llu times, but no unused OID has been found yet.",
retries,
(unsigned long long) retries)));
/* /*
* Double the number of retries to do before logging next until it * Double the number of retries to do before logging next until it
...@@ -400,8 +402,10 @@ GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn) ...@@ -400,8 +402,10 @@ GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
if (retries > GETNEWOID_LOG_THRESHOLD) if (retries > GETNEWOID_LOG_THRESHOLD)
{ {
ereport(LOG, ereport(LOG,
(errmsg("new OID has been assigned in relation \"%s\" after \"%llu\" retries", (errmsg_plural("new OID has been assigned in relation \"%s\" after %llu retry",
RelationGetRelationName(relation), (unsigned long long) retries))); "new OID has been assigned in relation \"%s\" after %llu retries",
retries,
RelationGetRelationName(relation), (unsigned long long) retries)));
} }
return newOid; return newOid;
......
...@@ -593,7 +593,7 @@ DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool expect_detach_pending, ...@@ -593,7 +593,7 @@ DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool expect_detach_pending,
errmsg("cannot detach partition \"%s\"", errmsg("cannot detach partition \"%s\"",
childname ? childname : "unknown relation"), childname ? childname : "unknown relation"),
errdetail("The partition is being detached concurrently or has an unfinished detach."), errdetail("The partition is being detached concurrently or has an unfinished detach."),
errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the pending detach operation"))); errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the pending detach operation.")));
if (!detach_pending && expect_detach_pending) if (!detach_pending && expect_detach_pending)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
......
...@@ -14773,7 +14773,7 @@ MarkInheritDetached(Relation child_rel, Relation parent_rel) ...@@ -14773,7 +14773,7 @@ MarkInheritDetached(Relation child_rel, Relation parent_rel)
get_rel_name(inhForm->inhrelid), get_rel_name(inhForm->inhrelid),
get_namespace_name(parent_rel->rd_rel->relnamespace), get_namespace_name(parent_rel->rd_rel->relnamespace),
RelationGetRelationName(parent_rel)), RelationGetRelationName(parent_rel)),
errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the detach operation.")); errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the pending detach operation."));
if (inhForm->inhrelid == RelationGetRelid(child_rel)) if (inhForm->inhrelid == RelationGetRelid(child_rel))
{ {
......
...@@ -1457,7 +1457,7 @@ pgstat_reset_shared_counters(const char *target) ...@@ -1457,7 +1457,7 @@ pgstat_reset_shared_counters(const char *target)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("unrecognized reset target: \"%s\"", target), errmsg("unrecognized reset target: \"%s\"", target),
errhint("Target must be \"archiver\", \"bgwriter\" or \"wal\"."))); errhint("Target must be \"archiver\", \"bgwriter\", or \"wal\".")));
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_RESETSHAREDCOUNTER); pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_RESETSHAREDCOUNTER);
pgstat_send(&msg, sizeof(msg)); pgstat_send(&msg, sizeof(msg));
......
...@@ -3295,13 +3295,13 @@ do_syncfs(const char *path) ...@@ -3295,13 +3295,13 @@ do_syncfs(const char *path)
{ {
ereport(LOG, ereport(LOG,
(errcode_for_file_access(), (errcode_for_file_access(),
errmsg("could not open %s: %m", path))); errmsg("could not open file \"%s\": %m", path)));
return; return;
} }
if (syncfs(fd) < 0) if (syncfs(fd) < 0)
ereport(LOG, ereport(LOG,
(errcode_for_file_access(), (errcode_for_file_access(),
errmsg("could not sync filesystem for \"%s\": %m", path))); errmsg("could not synchronize file system for file \"%s\": %m", path)));
CloseTransientFile(fd); CloseTransientFile(fd);
} }
#endif #endif
......
...@@ -303,7 +303,7 @@ LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start, ...@@ -303,7 +303,7 @@ LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
{ {
ereport(LOG, ereport(LOG,
errmsg("recovery still waiting after %ld.%03d ms: %s", errmsg("recovery still waiting after %ld.%03d ms: %s",
msecs, usecs, _(get_recovery_conflict_desc(reason))), msecs, usecs, get_recovery_conflict_desc(reason)),
nprocs > 0 ? errdetail_log_plural("Conflicting process: %s.", nprocs > 0 ? errdetail_log_plural("Conflicting process: %s.",
"Conflicting processes: %s.", "Conflicting processes: %s.",
nprocs, buf.data) : 0); nprocs, buf.data) : 0);
...@@ -312,7 +312,7 @@ LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start, ...@@ -312,7 +312,7 @@ LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
{ {
ereport(LOG, ereport(LOG,
errmsg("recovery finished waiting after %ld.%03d ms: %s", errmsg("recovery finished waiting after %ld.%03d ms: %s",
msecs, usecs, _(get_recovery_conflict_desc(reason)))); msecs, usecs, get_recovery_conflict_desc(reason)));
} }
if (nprocs > 0) if (nprocs > 0)
...@@ -1418,27 +1418,27 @@ LogStandbyInvalidations(int nmsgs, SharedInvalidationMessage *msgs, ...@@ -1418,27 +1418,27 @@ LogStandbyInvalidations(int nmsgs, SharedInvalidationMessage *msgs,
static const char * static const char *
get_recovery_conflict_desc(ProcSignalReason reason) get_recovery_conflict_desc(ProcSignalReason reason)
{ {
const char *reasonDesc = gettext_noop("unknown reason"); const char *reasonDesc = _("unknown reason");
switch (reason) switch (reason)
{ {
case PROCSIG_RECOVERY_CONFLICT_BUFFERPIN: case PROCSIG_RECOVERY_CONFLICT_BUFFERPIN:
reasonDesc = gettext_noop("recovery conflict on buffer pin"); reasonDesc = _("recovery conflict on buffer pin");
break; break;
case PROCSIG_RECOVERY_CONFLICT_LOCK: case PROCSIG_RECOVERY_CONFLICT_LOCK:
reasonDesc = gettext_noop("recovery conflict on lock"); reasonDesc = _("recovery conflict on lock");
break; break;
case PROCSIG_RECOVERY_CONFLICT_TABLESPACE: case PROCSIG_RECOVERY_CONFLICT_TABLESPACE:
reasonDesc = gettext_noop("recovery conflict on tablespace"); reasonDesc = _("recovery conflict on tablespace");
break; break;
case PROCSIG_RECOVERY_CONFLICT_SNAPSHOT: case PROCSIG_RECOVERY_CONFLICT_SNAPSHOT:
reasonDesc = gettext_noop("recovery conflict on snapshot"); reasonDesc = _("recovery conflict on snapshot");
break; break;
case PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK: case PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK:
reasonDesc = gettext_noop("recovery conflict on buffer deadlock"); reasonDesc = _("recovery conflict on buffer deadlock");
break; break;
case PROCSIG_RECOVERY_CONFLICT_DATABASE: case PROCSIG_RECOVERY_CONFLICT_DATABASE:
reasonDesc = gettext_noop("recovery conflict on database"); reasonDesc = _("recovery conflict on database");
break; break;
default: default:
break; break;
......
...@@ -145,7 +145,7 @@ fetch_fp_info(Oid func_id, struct fp_info *fip) ...@@ -145,7 +145,7 @@ fetch_fp_info(Oid func_id, struct fp_info *fip)
if (pp->prokind != PROKIND_FUNCTION || pp->proretset) if (pp->prokind != PROKIND_FUNCTION || pp->proretset)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot call function %s via fastpath interface", errmsg("cannot call function \"%s\" via fastpath interface",
NameStr(pp->proname)))); NameStr(pp->proname))));
/* watch out for catalog entries with more than FUNC_MAX_ARGS args */ /* watch out for catalog entries with more than FUNC_MAX_ARGS args */
......
...@@ -282,7 +282,7 @@ multirange_in(PG_FUNCTION_ARGS) ...@@ -282,7 +282,7 @@ multirange_in(PG_FUNCTION_ARGS)
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("malformed multirange literal: \"%s\"", errmsg("malformed multirange literal: \"%s\"",
input_str), input_str),
errdetail("Junk after right brace."))); errdetail("Junk after closing right brace.")));
ret = make_multirange(mltrngtypoid, rangetyp, range_count, ranges); ret = make_multirange(mltrngtypoid, rangetyp, range_count, ranges);
PG_RETURN_MULTIRANGE_P(ret); PG_RETURN_MULTIRANGE_P(ret);
...@@ -968,7 +968,7 @@ multirange_constructor2(PG_FUNCTION_ARGS) ...@@ -968,7 +968,7 @@ multirange_constructor2(PG_FUNCTION_ARGS)
if (dims > 1) if (dims > 1)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_CARDINALITY_VIOLATION), (errcode(ERRCODE_CARDINALITY_VIOLATION),
errmsg("multiranges cannot be constructed from multi-dimensional arrays"))); errmsg("multiranges cannot be constructed from multidimensional arrays")));
rngtypid = ARR_ELEMTYPE(rangeArray); rngtypid = ARR_ELEMTYPE(rangeArray);
if (rngtypid != rangetyp->type_id) if (rngtypid != rangetyp->type_id)
......
...@@ -14,7 +14,7 @@ Indexes: ...@@ -14,7 +14,7 @@ Indexes:
"idx" btree (f1) "idx" btree (f1)
CREATE TABLE cmdata1(f1 TEXT COMPRESSION lz4); CREATE TABLE cmdata1(f1 TEXT COMPRESSION lz4);
ERROR: unsupported LZ4 compression method ERROR: compression method lz4 not supported
DETAIL: This functionality requires the server to be built with lz4 support. DETAIL: This functionality requires the server to be built with lz4 support.
HINT: You need to rebuild PostgreSQL using --with-lz4. HINT: You need to rebuild PostgreSQL using --with-lz4.
INSERT INTO cmdata1 VALUES(repeat('1234567890', 1004)); INSERT INTO cmdata1 VALUES(repeat('1234567890', 1004));
...@@ -193,7 +193,7 @@ LINE 1: SELECT pg_column_compression(x) FROM compressmv; ...@@ -193,7 +193,7 @@ LINE 1: SELECT pg_column_compression(x) FROM compressmv;
^ ^
-- test compression with partition -- test compression with partition
CREATE TABLE cmpart(f1 text COMPRESSION lz4) PARTITION BY HASH(f1); CREATE TABLE cmpart(f1 text COMPRESSION lz4) PARTITION BY HASH(f1);
ERROR: unsupported LZ4 compression method ERROR: compression method lz4 not supported
DETAIL: This functionality requires the server to be built with lz4 support. DETAIL: This functionality requires the server to be built with lz4 support.
HINT: You need to rebuild PostgreSQL using --with-lz4. HINT: You need to rebuild PostgreSQL using --with-lz4.
CREATE TABLE cmpart1 PARTITION OF cmpart FOR VALUES WITH (MODULUS 2, REMAINDER 0); CREATE TABLE cmpart1 PARTITION OF cmpart FOR VALUES WITH (MODULUS 2, REMAINDER 0);
...@@ -238,7 +238,7 @@ HINT: Available values: pglz. ...@@ -238,7 +238,7 @@ HINT: Available values: pglz.
SET default_toast_compression = 'pglz'; SET default_toast_compression = 'pglz';
-- test alter compression method -- test alter compression method
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4; ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
ERROR: unsupported LZ4 compression method ERROR: compression method lz4 not supported
DETAIL: This functionality requires the server to be built with lz4 support. DETAIL: This functionality requires the server to be built with lz4 support.
HINT: You need to rebuild PostgreSQL using --with-lz4. HINT: You need to rebuild PostgreSQL using --with-lz4.
INSERT INTO cmdata VALUES (repeat('123456789', 4004)); INSERT INTO cmdata VALUES (repeat('123456789', 4004));
...@@ -272,7 +272,7 @@ ERROR: relation "compressmv" does not exist ...@@ -272,7 +272,7 @@ ERROR: relation "compressmv" does not exist
ALTER TABLE cmpart1 ALTER COLUMN f1 SET COMPRESSION pglz; ALTER TABLE cmpart1 ALTER COLUMN f1 SET COMPRESSION pglz;
ERROR: relation "cmpart1" does not exist ERROR: relation "cmpart1" does not exist
ALTER TABLE cmpart2 ALTER COLUMN f1 SET COMPRESSION lz4; ALTER TABLE cmpart2 ALTER COLUMN f1 SET COMPRESSION lz4;
ERROR: unsupported LZ4 compression method ERROR: compression method lz4 not supported
DETAIL: This functionality requires the server to be built with lz4 support. DETAIL: This functionality requires the server to be built with lz4 support.
HINT: You need to rebuild PostgreSQL using --with-lz4. HINT: You need to rebuild PostgreSQL using --with-lz4.
-- new data should be compressed with the current compression method -- new data should be compressed with the current compression method
...@@ -312,7 +312,7 @@ SELECT pg_column_compression(f1) FROM cmdata; ...@@ -312,7 +312,7 @@ SELECT pg_column_compression(f1) FROM cmdata;
-- test expression index -- test expression index
DROP TABLE cmdata2; DROP TABLE cmdata2;
CREATE TABLE cmdata2 (f1 TEXT COMPRESSION pglz, f2 TEXT COMPRESSION lz4); CREATE TABLE cmdata2 (f1 TEXT COMPRESSION pglz, f2 TEXT COMPRESSION lz4);
ERROR: unsupported LZ4 compression method ERROR: compression method lz4 not supported
DETAIL: This functionality requires the server to be built with lz4 support. DETAIL: This functionality requires the server to be built with lz4 support.
HINT: You need to rebuild PostgreSQL using --with-lz4. HINT: You need to rebuild PostgreSQL using --with-lz4.
CREATE UNIQUE INDEX idx1 ON cmdata2 ((f1 || f2)); CREATE UNIQUE INDEX idx1 ON cmdata2 ((f1 || f2));
......
...@@ -17,7 +17,7 @@ select '{(,)}.'::textmultirange; ...@@ -17,7 +17,7 @@ select '{(,)}.'::textmultirange;
ERROR: malformed multirange literal: "{(,)}." ERROR: malformed multirange literal: "{(,)}."
LINE 1: select '{(,)}.'::textmultirange; LINE 1: select '{(,)}.'::textmultirange;
^ ^
DETAIL: Junk after right brace. DETAIL: Junk after closing right brace.
select '{[a,c),}'::textmultirange; select '{[a,c),}'::textmultirange;
ERROR: malformed multirange literal: "{[a,c),}" ERROR: malformed multirange literal: "{[a,c),}"
LINE 1: select '{[a,c),}'::textmultirange; LINE 1: select '{[a,c),}'::textmultirange;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment