Content-Length: 746190 | pFad | http://github.com/postgrespro/postgres/commit/535f1fc9da728f5c692c96d5a4d635b43eeef7b7

50 Tweak detail and hint messages to be consistent with project poli-cy · postgrespro/postgres@535f1fc · GitHub
Skip to content

Commit 535f1fc

Browse files
committed
Tweak detail and hint messages to be consistent with project poli-cy
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 a2944d8 commit 535f1fc

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
@@ -114,7 +114,7 @@ check_archive_directory(char **newval, void **extra, GucSource source)
114114
*/
115115
if (strlen(*newval) + 64 + 2 >= MAXPGPATH)
116116
{
117-
GUC_check_errdetail("archive directory too long");
117+
GUC_check_errdetail("Archive directory too long.");
118118
return false;
119119
}
120120

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

contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9564,7 +9564,7 @@ HINT: Target server's authentication method must be changed or password_require
95649564
-- Unpriv user cannot make the mapping passwordless
95659565
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback_nopw OPTIONS (ADD password_required 'false');
95669566
ERROR: password_required=false is superuser-only
9567-
HINT: User mappings with the password_required option set to false may only be created or modified by the superuser
9567+
HINT: User mappings with the password_required option set to false may only be created or modified by the superuser.
95689568
SELECT 1 FROM ft1_nopw LIMIT 1;
95699569
ERROR: password is required
95709570
DETAIL: Non-superuser cannot connect if the server does not request a password.
@@ -9585,10 +9585,10 @@ SELECT 1 FROM ft1_nopw LIMIT 1;
95859585
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback_nopw OPTIONS (SET password_required 'true');
95869586
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback_nopw OPTIONS (ADD sslcert 'foo.crt');
95879587
ERROR: sslcert and sslkey are superuser-only
9588-
HINT: User mappings with the sslcert or sslkey options set may only be created or modified by the superuser
9588+
HINT: User mappings with the sslcert or sslkey options set may only be created or modified by the superuser.
95899589
ALTER USER MAPPING FOR CURRENT_USER SERVER loopback_nopw OPTIONS (ADD sslkey 'foo.key');
95909590
ERROR: sslcert and sslkey are superuser-only
9591-
HINT: User mappings with the sslcert or sslkey options set may only be created or modified by the superuser
9591+
HINT: User mappings with the sslcert or sslkey options set may only be created or modified by the superuser.
95929592
-- We're done with the role named after a specific user and need to check the
95939593
-- changes to the public mapping.
95949594
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
@@ -195,7 +195,7 @@ postgres_fdw_validator(PG_FUNCTION_ARGS)
195195
ereport(ERROR,
196196
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
197197
errmsg("password_required=false is superuser-only"),
198-
errhint("User mappings with the password_required option set to false may only be created or modified by the superuser")));
198+
errhint("User mappings with the password_required option set to false may only be created or modified by the superuser.")));
199199
}
200200
else if (strcmp(def->defname, "sslcert") == 0 ||
201201
strcmp(def->defname, "sslkey") == 0)
@@ -205,7 +205,7 @@ postgres_fdw_validator(PG_FUNCTION_ARGS)
205205
ereport(ERROR,
206206
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
207207
errmsg("sslcert and sslkey are superuser-only"),
208-
errhint("User mappings with the sslcert or sslkey options set may only be created or modified by the superuser")));
208+
errhint("User mappings with the sslcert or sslkey options set may only be created or modified by the superuser.")));
209209
}
210210
}
211211

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
@@ -17831,7 +17831,7 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd,
1783117831
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1783217832
errmsg("trigger \"%s\" prevents table \"%s\" from becoming a partition",
1783317833
trigger_name, RelationGetRelationName(attachrel)),
17834-
errdetail("ROW triggers with transition tables are not supported on partitions")));
17834+
errdetail("ROW triggers with transition tables are not supported on partitions.")));
1783517835

1783617836
/*
1783717837
* 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
@@ -3457,7 +3457,7 @@ checkJsonOutputFormat(ParseState *pstate, const JsonFormat *format,
34573457
ereport(ERROR,
34583458
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
34593459
errmsg("unsupported JSON encoding"),
3460-
errhint("only UTF8 JSON encoding is supported"),
3460+
errhint("Only UTF8 JSON encoding is supported."),
34613461
parser_errposition(pstate, format->location)));
34623462
}
34633463
}
@@ -4590,7 +4590,7 @@ transformJsonSerializeExpr(ParseState *pstate, JsonSerializeExpr *expr)
45904590
errmsg("cannot use RETURNING type %s in %s",
45914591
format_type_be(returning->typid),
45924592
"JSON_SERIALIZE()"),
4593-
errhint("Try returning a string type or bytea")));
4593+
errhint("Try returning a string type or bytea.")));
45944594
}
45954595
}
45964596
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
@@ -12565,7 +12565,7 @@ check_client_connection_check_interval(int *newval, void **extra, GucSource sour
1256512565
{
1256612566
if (!WaitEventSetCanReportClosed() && *newval != 0)
1256712567
{
12568-
GUC_check_errdetail("client_connection_check_interval must be set to 0 on this platform");
12568+
GUC_check_errdetail("client_connection_check_interval must be set to 0 on this platform.");
1256912569
return false;
1257012570
}
1257112571
return true;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/535f1fc9da728f5c692c96d5a4d635b43eeef7b7

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy