summaryrefslogtreecommitdiff
path: root/contrib/adminpack/expected
diff options
context:
space:
mode:
authorJoe Conway2020-07-04 10:26:53 +0000
committerJoe Conway2020-07-04 10:26:53 +0000
commit96d1f423f95d15c74989336e0776e1d55561a3f1 (patch)
tree1d068f5702830c636460e17854047710f23fb126 /contrib/adminpack/expected
parentca5e93f769e1bf5e90d080cfcc8c0368ef649a7c (diff)
Read until EOF vice stat-reported size in read_binary_file
read_binary_file(), used by SQL functions pg_read_file() and friends, uses stat to determine file length to read, when not passed an explicit length as an argument. This is problematic, for example, if the file being read is a virtual file with a stat-reported length of zero. Arrange to read until EOF, or StringInfo data string lenth limit, is reached instead. Original complaint and patch by me, with significant review, corrections, advice, and code optimizations by Tom Lane. Backpatched to v11. Prior to that only paths relative to the data and log dirs were allowed for files, so no "zero length" files were reachable anyway. Reviewed-By: Tom Lane Discussion: https://postgr.es/m/flat/969b8d82-5bb2-5fa8-4eb1-f0e685c5d736%40joeconway.com Backpatch-through: 11
Diffstat (limited to 'contrib/adminpack/expected')
-rw-r--r--contrib/adminpack/expected/adminpack.out4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/adminpack/expected/adminpack.out b/contrib/adminpack/expected/adminpack.out
index 5738b0f6c4d..edf3ebfcba3 100644
--- a/contrib/adminpack/expected/adminpack.out
+++ b/contrib/adminpack/expected/adminpack.out
@@ -79,7 +79,7 @@ SELECT pg_file_rename('test_file1', 'test_file2');
(1 row)
SELECT pg_read_file('test_file1'); -- not there
-ERROR: could not stat file "test_file1": No such file or directory
+ERROR: could not open file "test_file1" for reading: No such file or directory
SELECT pg_read_file('test_file2');
pg_read_file
--------------
@@ -108,7 +108,7 @@ SELECT pg_file_rename('test_file2', 'test_file3', 'test_file3_archive');
(1 row)
SELECT pg_read_file('test_file2'); -- not there
-ERROR: could not stat file "test_file2": No such file or directory
+ERROR: could not open file "test_file2" for reading: No such file or directory
SELECT pg_read_file('test_file3');
pg_read_file
--------------