8000 Tweak detail and hint messages to be consistent with project policy · postgrespro/postgres@12c254c · GitHub
[go: up one dir, main page]

Skip to content

Commit 12c254c

Browse files
committed
Tweak detail and hint messages to be consistent with project policy
Detail and hint messages should be full sentences and should end with a period, but some of the messages newly-introduced in v15 did not follow that. Author: Justin Pryzby Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/20220719120948.GF12702@telsasoft.com Backpatch-through: 15
1 parent ecc84b9 commit 12c254c

File tree

15 files changed

+43
-43
lines changed

15 files changed

+43
-43
lines changed

contrib/basic_archive/basic_archive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ check_archive_directory(char **newval, void **extra, GucSource source)
111111
*/
112112
if (strlen(*newval) + 64 + 2 >= MAXPGPATH)
113113
{
114-
GUC_check_errdetail("archive directory too long");
114+
GUC_check_errdetail("Archive directory too long.");
115115
return false;
116116
}
117117

@@ -122,7 +122,7 @@ check_archive_directory(char **newval, void **extra, GucSource source)
122122
*/
123123
if (stat(*newval, &st) != 0 || !S_ISDIR(st.st_mode))
124124
{
125-
GUC_check_errdetail("specified archive directory does not exist");
125+
GUC_check_errdetail("Specified archive directory does not exist.");
126126
return false;
127127
}
128128

contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9590,7 +9590,7 @@ HINT: Target server's authentication method must be changed or password_require
95909590
-- Unpriv user cannot make the mapping passwordless
95919591
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback_nopw OPTIONS (ADD password_required 'false');
95929592
ERROR: password_required=false is superuser-only
9593-
HINT: User mappings with the password_required option set to false may only be created or modified by the superuser
9593+
HINT: User mappings with the password_required option set to false may only be created or modified by the superuser.
95949594
SELECT 1 FROM ft1_nopw LIMIT 1;
95959595
ERROR: password is required
95969596
DETAIL: Non-superuser cannot connect if the server does not request a password.
@@ -9611,10 +9611,10 @@ SELECT 1 FROM ft1_nopw LIMIT 1;
96119611
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback_nopw OPTIONS (SET password_required 'true');
96129612
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback_nopw OPTIONS (ADD sslcert 'foo.crt');
96139613
ERROR: sslcert and sslkey are superuser-only
9614-
HINT: User mappings with the sslcert or sslkey options set may only be created or modified by the superuser
9614+
HINT: User mappings with the sslcert or sslkey options set may only be created or modified by the superuser.
96159615
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback_nopw OPTIONS (ADD sslkey 'foo.key');
96169616
ERROR: sslcert and sslkey are superuser-only
9617-
HINT: User mappings with the sslcert or sslkey options set may only be created or modified by the superuser
9617+
HINT: User mappings with the sslcert or sslkey options set may only be created or modified by the superuser.
96189618
-- We're done with the role named after a specific user and need to check the
96199619
-- changes to the public mapping.
96209620
DROP USER MAPPING FOR CURRENT_USER SERVER loopback_nopw;

contrib/postgres_fdw/option.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ postgres_fdw_validator(PG_FUNCTION_ARGS)
193193
ereport(ERROR,
194194
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
195195
errmsg("password_required=false is superuser-only"),
196-
errhint("User mappings with the password_required option set to false may only be created or modified by the superuser")));
196+
errhint("User mappings with the password_required option set to false may only be created or modified by the superuser.")));
197197
}
198198
else if (strcmp(def->defname, "sslcert") == 0 ||
199199
strcmp(def->defname, "sslkey") == 0)
@@ -203,7 +203,7 @@ postgres_fdw_validator(PG_FUNCTION_ARGS)
203203
ereport(ERROR,
204204
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
205205
errmsg("sslcert and sslkey are superuser-only"),
206-
errhint("User mappings with the sslcert or sslkey options set may only be created or modified by the superuser")));
206+
errhint("User mappings with the sslcert or sslkey options set may only be created or modified by the superuser.")));
207207
}
208208
}
209209

src/backend/commands/publicationcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ CheckPubRelationColumnList(List *tables, const char *queryString,
743743
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
744744
errmsg("cannot use publication column list for relation \"%s\"",
745745
RelationGetRelationName(pri->relation)),
746-
errdetail("column list cannot be used for a partitioned table when %s is false.",
746+
errdetail("Column list cannot be used for a partitioned table when %s is false.",
747747
"publish_via_partition_root")));
748748
}
749749
}

src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17790,7 +17790,7 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd,
1779017790
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1779117791
errmsg("trigger \"%s\" prevents table \"%s\" from becoming a partition",
1779217792
trigger_name, RelationGetRelationName(attachrel)),
17793-
errdetail("ROW triggers with transition tables are not supported on partitions")));
17793+
errdetail("ROW triggers with transition tables are not supported on partitions.")));
1779417794

1779517795
/*
1779617796
* Check that the new partition's bound is valid and does not overlap any

src/backend/parser/parse_expr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,7 +3447,7 @@ checkJsonOutputFormat(ParseState *pstate, const JsonFormat *format,
34473447
ereport(ERROR,
34483448
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
34493449
errmsg("unsupported JSON encoding"),
3450-
errhint("only UTF8 JSON encoding is supported"),
3450+
errhint("Only UTF8 JSON encoding is supported."),
34513451
parser_errposition(pstate, format->location)));
34523452
}
34533453
}
@@ -4580,7 +4580,7 @@ transformJsonSerializeExpr(ParseState *pstate, JsonSerializeExpr *expr)
45804580
errmsg("cannot use RETURNING type %s in %s",
45814581
format_type_be(returning->typid),
45824582
"JSON_SERIALIZE()"),
4583-
errhint("Try returning a string type or bytea")));
4583+
errhint("Try returning a string type or bytea.")));
45844584
}
45854585
}
45864586
else

src/backend/parser/parse_jsontable.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ registerJsonTableColumn(JsonTableContext *cxt, char *colname)
141141
ereport(ERROR,
142142
(errcode(ERRCODE_DUPLICATE_ALIAS),
143143
errmsg("duplicate JSON_TABLE column name: %s", colname),
144-
errhint("JSON_TABLE column names must be distinct from one another")));
144+
errhint("JSON_TABLE column names must be distinct from one another.")));
145145

146146
cxt->pathNames = lappend(cxt->pathNames, colname);
147147
}
@@ -258,7 +258,7 @@ validateJsonTableChildPlan(ParseState *pstate, JsonTablePlan *plan,
258258
ereport(ERROR,
259259
(errcode(ERRCODE_SYNTAX_ERROR),
260260
errmsg("invalid JSON_TABLE plan"),
261-
errdetail("plan node for nested path %s was not found in plan", jtc->pathname),
261+
errdetail("Plan node for nested path %s was not found in plan.", jtc->pathname),
262262
parser_errposition(pstate, jtc->location)));
263263

264264
nchildren++;
@@ -269,7 +269,7 @@ validateJsonTableChildPlan(ParseState *pstate, JsonTablePlan *plan,
269269
ereport(ERROR,
270270
(errcode(ERRCODE_SYNTAX_ERROR),
271271
errmsg("invalid JSON_TABLE plan"),
272-
errdetail("plan node contains some extra or duplicate sibling nodes"),
272+
errdetail("Plan node contains some extra or duplicate sibling nodes."),
273273
parser_errposition(pstate, plan ? plan->location : -1)));
274274
}
275275

@@ -385,7 +385,7 @@ transformJsonTableChildPlan(JsonTableContext *cxt, JsonTablePlan *plan,
385385
ereport(ERROR,
386386
(errcode(ERRCODE_SYNTAX_ERROR),
387387
errmsg("invalid JSON_TABLE plan"),
388-
errdetail("path name was %s not found in nested columns list",
388+
errdetail("Path name was %s not found in nested columns list.",
389389
plan->pathname),
390390
parser_errposition(cxt->pstate, plan->location)));
391391

@@ -586,7 +586,7 @@ transformJsonTableColumns(JsonTableContext *cxt, JsonTablePlan *plan,
586586
ereport(ERROR,
587587
(errcode(ERRCODE_SYNTAX_ERROR),
588588
errmsg("invalid JSON_TABLE plan"),
589-
errdetail("expected INNER or OUTER JSON_TABLE plan node"),
589+
errdetail("Expected INNER or OUTER JSON_TABLE plan node."),
590590
parser_errposition(cxt->pstate, plan->location)));
591591

592592
parentPlan = plan->plan1;
@@ -605,7 +605,7 @@ transformJsonTableColumns(JsonTableContext *cxt, JsonTablePlan *plan,
605605
ereport(ERROR,
606606
(errcode(ERRCODE_SYNTAX_ERROR),
607607
errmsg("invalid JSON_TABLE plan"),
608-
errdetail("path name mismatch: expected %s but %s is given",
608+
errdetail("Path name mismatch: expected %s but %s is given.",
609609
*pathName, parentPlan->pathname),
610610
parser_errposition(cxt->pstate, plan->location)));
611611

src/backend/utils/adt/jsonpath_exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2973,8 +2973,8 @@ JsonPathQuery(Datum jb, JsonPath *jp, JsonWrapper wrapper, bool *empty,
29732973
(errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM),
29742974
errmsg("JSON path expression in JSON_QUERY should return "
29752975
"singleton item without wrapper"),
2976-
errhint("use WITH WRAPPER clause to wrap SQL/JSON item "
2977-
"sequence into array")));
2976+
errhint("Use WITH WRAPPER clause to wrap SQL/JSON item "
2977+
"sequence into array.")));
29782978
}
29792979

29802980
if (first)

src/backend/utils/adt/jsonpath_gram.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ makeItemLikeRegex(JsonPathParseItem *expr, JsonPathString *pattern,
526526
ereport(ERROR,
527527
(errcode(ERRCODE_SYNTAX_ERROR),
528528
errmsg("invalid input syntax for type %s", "jsonpath"),
529-
errdetail("unrecognized flag character \"%.*s\" in LIKE_REGEX predicate",
529+
errdetail("Unrecognized flag character \"%.*s\" in LIKE_REGEX predicate.",
530530
pg_mblen(flags->val + i), flags->val + i)));
531531
break;
532532
}

src/backend/utils/misc/guc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12551,7 +12551,7 @@ check_client_connection_check_interval(int *newval, void **extra, GucSource sour
1255112551
{
1255212552
if (!WaitEventSetCanReportClosed() && *newval != 0)
1255312553
{
12554-
GUC_check_errdetail("client_connection_check_interval must be set to 0 on this platform");
12554+
GUC_check_errdetail("client_connection_check_interval must be set to 0 on this platform.");
1255512555
return false;
1255612556
}
1255712557
return true;

0 commit comments

Comments
 (0)
0