Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+2-2
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

+3-3
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

+2-2
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

+1-1
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

+1-1
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

+2-2
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

+6-6
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

+2-2
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

+1-1
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

+1-1
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;

src/test/regress/expected/jsonb_sqljson.out

+14-14
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ SELECT JSON_QUERY(jsonb '[]', '$[*]' ERROR ON ERROR);
716716

717717
SELECT JSON_QUERY(jsonb '[1,2]', '$[*]' ERROR ON ERROR);
718718
ERROR: JSON path expression in JSON_QUERY should return singleton item without wrapper
719-
HINT: use WITH WRAPPER clause to wrap SQL/JSON item sequence into array
719+
HINT: Use WITH WRAPPER clause to wrap SQL/JSON item sequence into array.
720720
SELECT JSON_QUERY(jsonb '[1,2]', '$[*]' DEFAULT '"empty"' ON ERROR);
721721
json_query
722722
------------
@@ -1378,7 +1378,7 @@ SELECT * FROM JSON_TABLE(
13781378
)
13791379
) jt;
13801380
ERROR: duplicate JSON_TABLE column name: a
1381-
HINT: JSON_TABLE column names must be distinct from one another
1381+
HINT: JSON_TABLE column names must be distinct from one another.
13821382
SELECT * FROM JSON_TABLE(
13831383
jsonb '[]', '$' AS a
13841384
COLUMNS (
@@ -1390,7 +1390,7 @@ SELECT * FROM JSON_TABLE(
13901390
)
13911391
) jt;
13921392
ERROR: duplicate JSON_TABLE column name: a
1393-
HINT: JSON_TABLE column names must be distinct from one another
1393+
HINT: JSON_TABLE column names must be distinct from one another.
13941394
SELECT * FROM JSON_TABLE(
13951395
jsonb '[]', '$'
13961396
COLUMNS (
@@ -1402,7 +1402,7 @@ SELECT * FROM JSON_TABLE(
14021402
)
14031403
) jt;
14041404
ERROR: duplicate JSON_TABLE column name: b
1405-
HINT: JSON_TABLE column names must be distinct from one another
1405+
HINT: JSON_TABLE column names must be distinct from one another.
14061406
SELECT * FROM JSON_TABLE(
14071407
jsonb '[]', '$'
14081408
COLUMNS (
@@ -1420,7 +1420,7 @@ SELECT * FROM JSON_TABLE(
14201420
)
14211421
) jt;
14221422
ERROR: duplicate JSON_TABLE column name: a
1423-
HINT: JSON_TABLE column names must be distinct from one another
1423+
HINT: JSON_TABLE column names must be distinct from one another.
14241424
-- JSON_TABLE: plan validation
14251425
SELECT * FROM JSON_TABLE(
14261426
jsonb 'null', '$[*]' AS p0
@@ -1438,7 +1438,7 @@ SELECT * FROM JSON_TABLE(
14381438
ERROR: invalid JSON_TABLE plan
14391439
LINE 12: PLAN (p1)
14401440
^
1441-
DETAIL: path name mismatch: expected p0 but p1 is given
1441+
DETAIL: Path name mismatch: expected p0 but p1 is given.
14421442
SELECT * FROM JSON_TABLE(
14431443
jsonb 'null', '$[*]' AS p0
14441444
COLUMNS (
@@ -1455,7 +1455,7 @@ SELECT * FROM JSON_TABLE(
14551455
ERROR: invalid JSON_TABLE plan
14561456
LINE 4: NESTED PATH '$' AS p1 COLUMNS (
14571457
^
1458-
DETAIL: plan node for nested path p1 was not found in plan
1458+
DETAIL: Plan node for nested path p1 was not found in plan.
14591459
SELECT * FROM JSON_TABLE(
14601460
jsonb 'null', '$[*]' AS p0
14611461
COLUMNS (
@@ -1472,7 +1472,7 @@ SELECT * FROM JSON_TABLE(
14721472
ERROR: invalid JSON_TABLE plan
14731473
LINE 4: NESTED PATH '$' AS p1 COLUMNS (
14741474
^
1475-
DETAIL: plan node for nested path p1 was not found in plan
1475+
DETAIL: Plan node for nested path p1 was not found in plan.
14761476
SELECT * FROM JSON_TABLE(
14771477
jsonb 'null', '$[*]' AS p0
14781478
COLUMNS (
@@ -1489,7 +1489,7 @@ SELECT * FROM JSON_TABLE(
14891489
ERROR: invalid JSON_TABLE plan
14901490
LINE 12: PLAN (p0 UNION p1 UNION p11)
14911491
^
1492-
DETAIL: expected INNER or OUTER JSON_TABLE plan node
1492+
DETAIL: Expected INNER or OUTER JSON_TABLE plan node.
14931493
SELECT * FROM JSON_TABLE(
14941494
jsonb 'null', '$[*]' AS p0
14951495
COLUMNS (
@@ -1506,7 +1506,7 @@ SELECT * FROM JSON_TABLE(
15061506
ERROR: invalid JSON_TABLE plan
15071507
LINE 8: NESTED PATH '$' AS p2 COLUMNS (
15081508
^
1509-
DETAIL: plan node for nested path p2 was not found in plan
1509+
DETAIL: Plan node for nested path p2 was not found in plan.
15101510
SELECT * FROM JSON_TABLE(
15111511
jsonb 'null', '$[*]' AS p0
15121512
COLUMNS (
@@ -1523,7 +1523,7 @@ SELECT * FROM JSON_TABLE(
15231523
ERROR: invalid JSON_TABLE plan
15241524
LINE 5: NESTED PATH '$' AS p11 COLUMNS ( foo int ),
15251525
^
1526-
DETAIL: plan node for nested path p11 was not found in plan
1526+
DETAIL: Plan node for nested path p11 was not found in plan.
15271527
SELECT * FROM JSON_TABLE(
15281528
jsonb 'null', '$[*]' AS p0
15291529
COLUMNS (
@@ -1540,7 +1540,7 @@ SELECT * FROM JSON_TABLE(
15401540
ERROR: invalid JSON_TABLE plan
15411541
LINE 12: PLAN (p0 OUTER ((p1 UNION p11) CROSS p2))
15421542
^
1543-
DETAIL: plan node contains some extra or duplicate sibling nodes
1543+
DETAIL: Plan node contains some extra or duplicate sibling nodes.
15441544
SELECT * FROM JSON_TABLE(
15451545
jsonb 'null', '$[*]' AS p0
15461546
COLUMNS (
@@ -1557,7 +1557,7 @@ SELECT * FROM JSON_TABLE(
15571557
ERROR: invalid JSON_TABLE plan
15581558
LINE 6: NESTED PATH '$' AS p12 COLUMNS ( bar int )
15591559
^
1560-
DETAIL: plan node for nested path p12 was not found in plan
1560+
DETAIL: Plan node for nested path p12 was not found in plan.
15611561
SELECT * FROM JSON_TABLE(
15621562
jsonb 'null', '$[*]' AS p0
15631563
COLUMNS (
@@ -1574,7 +1574,7 @@ SELECT * FROM JSON_TABLE(
15741574
ERROR: invalid JSON_TABLE plan
15751575
LINE 9: NESTED PATH '$' AS p21 COLUMNS ( baz int )
15761576
^
1577-
DETAIL: plan node for nested path p21 was not found in plan
1577+
DETAIL: Plan node for nested path p21 was not found in plan.
15781578
SELECT * FROM JSON_TABLE(
15791579
jsonb 'null', 'strict $[*]' AS p0
15801580
COLUMNS (

src/test/regress/expected/jsonpath.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
477477
ERROR: invalid input syntax for type jsonpath
478478
LINE 1: select '$ ? (@ like_regex "pattern" flag "a")'::jsonpath;
479479
^
480-
DETAIL: unrecognized flag character "a" in LIKE_REGEX predicate
480+
DETAIL: Unrecognized flag character "a" in LIKE_REGEX predicate.
481481
select '$ < 1'::jsonpath;
482482
jsonpath
483483
----------

src/test/regress/expected/publication.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ ALTER PUBLICATION testpub6 SET (PUBLISH_VIA_PARTITION_ROOT=0);
940940
-- fail - cannot use column list for partitioned table
941941
ALTER PUBLICATION testpub6 SET TABLE rf_tbl_abcd_part_pk (a);
942942
ERROR: cannot use publication column list for relation "rf_tbl_abcd_part_pk"
943-
DETAIL: column list cannot be used for a partitioned table when publish_via_partition_root is false.
943+
DETAIL: Column list cannot be used for a partitioned table when publish_via_partition_root is false.
944944
-- ok - can use column list for partition
945945
ALTER PUBLICATION testpub6 SET TABLE rf_tbl_abcd_part_pk_1 (a);
946946
-- ok - "a" is a PK col

src/test/regress/expected/sqljson.out

+5-5
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ SELECT pg_typeof(JSON_SERIALIZE(NULL));
317317
-- only string types or bytea allowed
318318
SELECT JSON_SERIALIZE('{ "a" : 1 } ' RETURNING jsonb);
319319
ERROR: cannot use RETURNING type jsonb in JSON_SERIALIZE()
320-
HINT: Try returning a string type or bytea
320+
HINT: Try returning a string type or bytea.
321321
EXPLAIN (VERBOSE, COSTS OFF) SELECT JSON_SERIALIZE('{}');
322322
QUERY PLAN
323323
-----------------------------------------------------
@@ -403,12 +403,12 @@ SELECT JSON_OBJECT(RETURNING bytea FORMAT JSON ENCODING UTF16);
403403
ERROR: unsupported JSON encoding
404404
LINE 1: SELECT JSON_OBJECT(RETURNING bytea FORMAT JSON ENCODING UTF1...
405405
^
406-
HINT: only UTF8 JSON encoding is supported
406+
HINT: Only UTF8 JSON encoding is supported.
407407
SELECT JSON_OBJECT(RETURNING bytea FORMAT JSON ENCODING UTF32);
408408
ERROR: unsupported JSON encoding
409409
LINE 1: SELECT JSON_OBJECT(RETURNING bytea FORMAT JSON ENCODING UTF3...
410410
^
411-
HINT: only UTF8 JSON encoding is supported
411+
HINT: Only UTF8 JSON encoding is supported.
412412
SELECT JSON_OBJECT('foo': NULL::int FORMAT JSON);
413413
ERROR: cannot use non-string types with explicit FORMAT JSON clause
414414
LINE 1: SELECT JSON_OBJECT('foo': NULL::int FORMAT JSON);
@@ -691,12 +691,12 @@ SELECT JSON_ARRAY(RETURNING bytea FORMAT JSON ENCODING UTF16);
691691
ERROR: unsupported JSON encoding
692692
LINE 1: SELECT JSON_ARRAY(RETURNING bytea FORMAT JSON ENCODING UTF16...
693693
^
694-
HINT: only UTF8 JSON encoding is supported
694+
HINT: Only UTF8 JSON encoding is supported.
695695
SELECT JSON_ARRAY(RETURNING bytea FORMAT JSON ENCODING UTF32);
696696
ERROR: unsupported JSON encoding
697697
LINE 1: SELECT JSON_ARRAY(RETURNING bytea FORMAT JSON ENCODING UTF32...
698698
^
699-
HINT: only UTF8 JSON encoding is supported
699+
HINT: Only UTF8 JSON encoding is supported.
700700
SELECT JSON_ARRAY('aaa', 111, true, array[1,2,3], NULL, json '{"a": [1]}', jsonb '["a",3]');
701701
json_array
702702
-----------------------------------------------------

src/test/regress/expected/triggers.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -2951,7 +2951,7 @@ create trigger child_row_trig
29512951
-- but now we're not allowed to reattach it
29522952
alter table parent attach partition child for values in ('AAA');
29532953
ERROR: trigger "child_row_trig" prevents table "child" from becoming a partition
2954-
DETAIL: ROW triggers with transition tables are not supported on partitions
2954+
DETAIL: ROW triggers with transition tables are not supported on partitions.
29552955
-- drop the trigger, and now we're allowed to attach it again
29562956
drop trigger child_row_trig on child;
29572957
alter table parent attach partition child for values in ('AAA');

0 commit comments

Comments
 (0)