postgres.git / summary / log / commit / refs
commit bddbbdf99b16b4f3abaa05d6e1d8ee209efeaa7a
Author: Michael Paquier <michael@paquier.xyz>
Date: Thu Sep 14 07:00:47 2023 +0000
First released in: 17.0, 11.22, 12.17, 13.13, 14.10, 15.5, 16.1
Revert "Improve error message on snapshot import in snapmgr.c"
This reverts commit a0d87bcd9b57, following a remark from Andres Frend
that the new error can be triggered with an incorrect SET TRANSACTION
SNAPSHOT command without being really helpful for the user as it uses
the internal file name.
Discussion: https://postgr.es/m/20230914020724.hlks7vunitvtbbz4@awork3.anarazel.de
Backpatch-through: 11
src/backend/utils/time/snapmgr.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 2f17a433455..8fadec32c5f 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -1496,9 +1496,8 @@ ImportSnapshot(const char *idstr)
f = AllocateFile(path, PG_BINARY_R);
if (!f)
ereport(ERROR,
- (errcode_for_file_access(),
- errmsg("could not open file \"%s\" for reading: %m",
- path)));
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid snapshot identifier: \"%s\"", idstr)));
/* get the size of the file so that we know how much memory we need */
if (fstat(fileno(f), &stat_buf))
[parent: a4cef3384d6d]