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
pull/137/head
Tom Lane 2 years ago
parent 442f870065
commit 2333803d84
  1. 2
      contrib/adminpack/adminpack.c
  2. 2
      contrib/adminpack/expected/adminpack.out
  3. 2
      src/backend/utils/adt/genfile.c

@ -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;
}

@ -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);

@ -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;
}

Loading…
Cancel
Save