From: Peter Eisentraut Date: Fri, 11 Dec 2015 03:05:27 +0000 (-0500) Subject: Improve some messages X-Git-Tag: REL9_6_BETA1~1017 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a351705d8a7fbbc98c2449786d2ddfa845f21b6a;p=postgresql Improve some messages --- diff --git a/src/backend/access/transam/commit_ts.c b/src/backend/access/transam/commit_ts.c index f9da759312..834010ff71 100644 --- a/src/backend/access/transam/commit_ts.c +++ b/src/backend/access/transam/commit_ts.c @@ -384,7 +384,7 @@ error_commit_ts_disabled(void) (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("could not get commit timestamp data"), RecoveryInProgress() ? - errhint("Make sure the configuration parameter \"%s\" is set in the master server.", + errhint("Make sure the configuration parameter \"%s\" is set on the master server.", "track_commit_timestamp") : errhint("Make sure the configuration parameter \"%s\" is set.", "track_commit_timestamp"))); diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index b90faa6e72..e44d7d09e1 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -1901,7 +1901,7 @@ pg_get_object_address(PG_FUNCTION_ARGS) if (list_length(name) < 1) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("name list must be of length at least %d", 1))); + errmsg("name list length must be at least %d", 1))); } /* diff --git a/src/backend/commands/policy.c b/src/backend/commands/policy.c index 8851fe7c9f..6399b2e3eb 100644 --- a/src/backend/commands/policy.c +++ b/src/backend/commands/policy.c @@ -167,8 +167,8 @@ policy_role_list_to_array(List *roles, int *num_roles) { ereport(WARNING, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("ignoring roles specified other than public"), - errhint("All roles are members of the public role."))); + errmsg("ignoring specified roles other than PUBLIC"), + errhint("All roles are members of the PUBLIC role."))); *num_roles = 1; } role_oids[0] = ObjectIdGetDatum(ACL_ID_PUBLIC); diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 295e0b0fdf..2961ccb8ef 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -959,7 +959,7 @@ DropRole(DropRoleStmt *stmt) if (rolspec->roletype != ROLESPEC_CSTRING) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("cannot use special role specifier in \"%s\"", "DROP ROLE"))); + errmsg("cannot use special role specifier in DROP ROLE"))); role = rolspec->rolename; tuple = SearchSysCache1(AUTHNAME, PointerGetDatum(role)); diff --git a/src/backend/executor/nodeCustom.c b/src/backend/executor/nodeCustom.c index 0a022dff94..ac7bee0237 100644 --- a/src/backend/executor/nodeCustom.c +++ b/src/backend/executor/nodeCustom.c @@ -144,7 +144,7 @@ ExecCustomMarkPos(CustomScanState *node) if (!node->methods->MarkPosCustomScan) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("custom-scan \"%s\" does not support MarkPos", + errmsg("custom scan \"%s\" does not support MarkPos", node->methods->CustomName))); node->methods->MarkPosCustomScan(node); } @@ -155,7 +155,7 @@ ExecCustomRestrPos(CustomScanState *node) if (!node->methods->RestrPosCustomScan) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("custom-scan \"%s\" does not support MarkPos", + errmsg("custom scan \"%s\" does not support MarkPos", node->methods->CustomName))); node->methods->RestrPosCustomScan(node); } diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c index 0c14a3bfda..5bebc952fa 100644 --- a/src/backend/utils/adt/jsonb.c +++ b/src/backend/utils/adt/jsonb.c @@ -1238,7 +1238,7 @@ jsonb_build_object(PG_FUNCTION_ARGS) if (val_type == InvalidOid || val_type == UNKNOWNOID) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("arg %d: could not determine data type", i + 2))); + errmsg("argument %d: could not determine data type", i + 2))); add_jsonb(arg, PG_ARGISNULL(i + 1), &result, val_type, false); } @@ -1300,7 +1300,7 @@ jsonb_build_array(PG_FUNCTION_ARGS) if (val_type == InvalidOid || val_type == UNKNOWNOID) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("arg %d: could not determine data type", i + 1))); + errmsg("argument %d: could not determine data type", i + 1))); add_jsonb(arg, PG_ARGISNULL(i), &result, val_type, false); } diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c index 222acd7afb..80018de6f0 100644 --- a/src/backend/utils/adt/jsonfuncs.c +++ b/src/backend/utils/adt/jsonfuncs.c @@ -3464,7 +3464,7 @@ jsonb_delete_idx(PG_FUNCTION_ARGS) if (JB_ROOT_IS_OBJECT(in)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("cannot delete from object using integer subscript"))); + errmsg("cannot delete from object using integer index"))); if (JB_ROOT_COUNT(in) == 0) PG_RETURN_JSONB(in); diff --git a/src/test/regress/expected/jsonb.out b/src/test/regress/expected/jsonb.out index 8d9b5db38d..72fe808734 100644 --- a/src/test/regress/expected/jsonb.out +++ b/src/test/regress/expected/jsonb.out @@ -3173,7 +3173,7 @@ select '[]'::jsonb - 'a'; select '"a"'::jsonb - 1; -- error ERROR: cannot delete from scalar select '{}'::jsonb - 1; -- error -ERROR: cannot delete from object using integer subscript +ERROR: cannot delete from object using integer index select '[]'::jsonb - 1; ?column? ---------- diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out index 963b7ef4dd..75751bebef 100644 --- a/src/test/regress/expected/object_address.out +++ b/src/test/regress/expected/object_address.out @@ -39,7 +39,7 @@ CREATE TRANSFORM FOR int LANGUAGE SQL ( SELECT pg_get_object_address('stone', '{}', '{}'); ERROR: unrecognized object type "stone" SELECT pg_get_object_address('table', '{}', '{}'); -ERROR: name list must be of length at least 1 +ERROR: name list length must be at least 1 SELECT pg_get_object_address('table', '{NULL}', '{}'); ERROR: name or argument lists may not contain nulls -- unrecognized object types