summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier2023-09-14 07:00:01 +0000
committerMichael Paquier2023-09-14 07:00:01 +0000
commitbe022908cfe2959dbb17c10475deeb492b8e6944 (patch)
treec7206e0406fcc8d97a522b2d6b78fb2e6590844c
parente0b2eed047df9045664da6f724cb42c10f8b12f0 (diff)
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/[email protected] Backpatch-through: 11
-rw-r--r--src/backend/utils/time/snapmgr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 65230811c0..b20440ee21 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -1391,9 +1391,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))