Commit a351705d authored by Peter Eisentraut's avatar Peter Eisentraut

Improve some messages

parent 8b469bd7
...@@ -384,7 +384,7 @@ error_commit_ts_disabled(void) ...@@ -384,7 +384,7 @@ error_commit_ts_disabled(void)
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("could not get commit timestamp data"), errmsg("could not get commit timestamp data"),
RecoveryInProgress() ? 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") : "track_commit_timestamp") :
errhint("Make sure the configuration parameter \"%s\" is set.", errhint("Make sure the configuration parameter \"%s\" is set.",
"track_commit_timestamp"))); "track_commit_timestamp")));
......
...@@ -1901,7 +1901,7 @@ pg_get_object_address(PG_FUNCTION_ARGS) ...@@ -1901,7 +1901,7 @@ pg_get_object_address(PG_FUNCTION_ARGS)
if (list_length(name) < 1) if (list_length(name) < 1)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (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)));
} }
/* /*
......
...@@ -167,8 +167,8 @@ policy_role_list_to_array(List *roles, int *num_roles) ...@@ -167,8 +167,8 @@ policy_role_list_to_array(List *roles, int *num_roles)
{ {
ereport(WARNING, ereport(WARNING,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("ignoring roles specified other than public"), errmsg("ignoring specified roles other than PUBLIC"),
errhint("All roles are members of the public role."))); errhint("All roles are members of the PUBLIC role.")));
*num_roles = 1; *num_roles = 1;
} }
role_oids[0] = ObjectIdGetDatum(ACL_ID_PUBLIC); role_oids[0] = ObjectIdGetDatum(ACL_ID_PUBLIC);
......
...@@ -959,7 +959,7 @@ DropRole(DropRoleStmt *stmt) ...@@ -959,7 +959,7 @@ DropRole(DropRoleStmt *stmt)
if (rolspec->roletype != ROLESPEC_CSTRING) if (rolspec->roletype != ROLESPEC_CSTRING)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (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; role = rolspec->rolename;
tuple = SearchSysCache1(AUTHNAME, PointerGetDatum(role)); tuple = SearchSysCache1(AUTHNAME, PointerGetDatum(role));
......
...@@ -144,7 +144,7 @@ ExecCustomMarkPos(CustomScanState *node) ...@@ -144,7 +144,7 @@ ExecCustomMarkPos(CustomScanState *node)
if (!node->methods->MarkPosCustomScan) if (!node->methods->MarkPosCustomScan)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (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->CustomName)));
node->methods->MarkPosCustomScan(node); node->methods->MarkPosCustomScan(node);
} }
...@@ -155,7 +155,7 @@ ExecCustomRestrPos(CustomScanState *node) ...@@ -155,7 +155,7 @@ ExecCustomRestrPos(CustomScanState *node)
if (!node->methods->RestrPosCustomScan) if (!node->methods->RestrPosCustomScan)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (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->CustomName)));
node->methods->RestrPosCustomScan(node); node->methods->RestrPosCustomScan(node);
} }
...@@ -1238,7 +1238,7 @@ jsonb_build_object(PG_FUNCTION_ARGS) ...@@ -1238,7 +1238,7 @@ jsonb_build_object(PG_FUNCTION_ARGS)
if (val_type == InvalidOid || val_type == UNKNOWNOID) if (val_type == InvalidOid || val_type == UNKNOWNOID)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (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); add_jsonb(arg, PG_ARGISNULL(i + 1), &result, val_type, false);
} }
...@@ -1300,7 +1300,7 @@ jsonb_build_array(PG_FUNCTION_ARGS) ...@@ -1300,7 +1300,7 @@ jsonb_build_array(PG_FUNCTION_ARGS)
if (val_type == InvalidOid || val_type == UNKNOWNOID) if (val_type == InvalidOid || val_type == UNKNOWNOID)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (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); add_jsonb(arg, PG_ARGISNULL(i), &result, val_type, false);
} }
......
...@@ -3464,7 +3464,7 @@ jsonb_delete_idx(PG_FUNCTION_ARGS) ...@@ -3464,7 +3464,7 @@ jsonb_delete_idx(PG_FUNCTION_ARGS)
if (JB_ROOT_IS_OBJECT(in)) if (JB_ROOT_IS_OBJECT(in))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (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) if (JB_ROOT_COUNT(in) == 0)
PG_RETURN_JSONB(in); PG_RETURN_JSONB(in);
......
...@@ -3173,7 +3173,7 @@ select '[]'::jsonb - 'a'; ...@@ -3173,7 +3173,7 @@ select '[]'::jsonb - 'a';
select '"a"'::jsonb - 1; -- error select '"a"'::jsonb - 1; -- error
ERROR: cannot delete from scalar ERROR: cannot delete from scalar
select '{}'::jsonb - 1; -- error select '{}'::jsonb - 1; -- error
ERROR: cannot delete from object using integer subscript ERROR: cannot delete from object using integer index
select '[]'::jsonb - 1; select '[]'::jsonb - 1;
?column? ?column?
---------- ----------
......
...@@ -39,7 +39,7 @@ CREATE TRANSFORM FOR int LANGUAGE SQL ( ...@@ -39,7 +39,7 @@ CREATE TRANSFORM FOR int LANGUAGE SQL (
SELECT pg_get_object_address('stone', '{}', '{}'); SELECT pg_get_object_address('stone', '{}', '{}');
ERROR: unrecognized object type "stone" ERROR: unrecognized object type "stone"
SELECT pg_get_object_address('table', '{}', '{}'); 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}', '{}'); SELECT pg_get_object_address('table', '{NULL}', '{}');
ERROR: name or argument lists may not contain nulls ERROR: name or argument lists may not contain nulls
-- unrecognized object types -- unrecognized object types
......
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