1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-04 12:42:24 +03:00

Use "data directory" not "current directory" in error messages.

The user receiving the message might not understand where the
server's "current directory" is.  "Data directory" seems clearer.
(This would not be good for frontend code, but both of these
messages are only issued in the backend.)

Kyotaro Horiguchi

Discussion: https://postgr.es/m/20230316.111646.1564684434328830712.horikyota.ntt@gmail.com
This commit is contained in:
Tom Lane 2023-03-16 12:04:08 -04:00
parent 442f870065
commit 2333803d84
3 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ convert_and_check_filename(text *arg)
else if (!path_is_relative_and_below_cwd(filename))
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("path must be in or below the current directory")));
errmsg("path must be in or below the data directory")));
return filename;
}

View File

@ -41,7 +41,7 @@ GRANT pg_read_all_settings TO regress_adminpack_user1;
GRANT EXECUTE ON FUNCTION pg_file_write(text,text,bool) TO regress_adminpack_user1;
SET ROLE regress_adminpack_user1;
SELECT pg_file_write('../test_file0', 'test0', false);
ERROR: path must be in or below the current directory
ERROR: path must be in or below the data directory
SELECT pg_file_write('/tmp/test_file0', 'test0', false);
ERROR: absolute path not allowed
SELECT pg_file_write(current_setting('data_directory') || '/test_file4', 'test4', false);

View File

@ -86,7 +86,7 @@ convert_and_check_filename(text *arg)
else if (!path_is_relative_and_below_cwd(filename))
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("path must be in or below the current directory")));
errmsg("path must be in or below the data directory")));
return filename;
}