Skip to content

Commit 50d44c1

Browse files
committed
Revert "Improve error message on snapshot import in snapmgr.c"
This reverts commit a0d87bc, 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
1 parent 33bc7d4 commit 50d44c1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/backend/utils/time/snapmgr.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,9 +1540,8 @@ ImportSnapshot(const char *idstr)
15401540
f = AllocateFile(path, PG_BINARY_R);
15411541
if (!f)
15421542
ereport(ERROR,
1543-
(errcode_for_file_access(),
1544-
errmsg("could not open file \"%s\" for reading: %m",
1545-
path)));
1543+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1544+
errmsg("invalid snapshot identifier: \"%s\"", idstr)));
15461545

15471546
/* get the size of the file so that we know how much memory we need */
15481547
if (fstat(fileno(f), &stat_buf))

0 commit comments

Comments
 (0)