summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2023-03-16 16:04:08 +0000
committerTom Lane2023-03-16 16:04:08 +0000
commit2333803d84ddabedc5ec5940a180245b4d4dfcca (patch)
tree45a052103afc551eb763fa0e1674cd1f509f8273
parent442f8700656bb5ce525d352241a17bbab14193c7 (diff)
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/[email protected]
-rw-r--r--contrib/adminpack/adminpack.c2
-rw-r--r--contrib/adminpack/expected/adminpack.out2
-rw-r--r--src/backend/utils/adt/genfile.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/contrib/adminpack/adminpack.c b/contrib/adminpack/adminpack.c
index 357b671a6c6..d3aec7b685b 100644
--- a/contrib/adminpack/adminpack.c
+++ b/contrib/adminpack/adminpack.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;
}
diff --git a/contrib/adminpack/expected/adminpack.out b/contrib/adminpack/expected/adminpack.out
index 6bcf2217f25..f419a5ea1df 100644
--- a/contrib/adminpack/expected/adminpack.out
+++ b/contrib/adminpack/expected/adminpack.out
@@ -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);
diff --git a/src/backend/utils/adt/genfile.c b/src/backend/utils/adt/genfile.c
index 75588eebb34..f281ce98068 100644
--- a/src/backend/utils/adt/genfile.c
+++ b/src/backend/utils/adt/genfile.c
@@ -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;
}