Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbe3dfd3

Browse files
committed
Improve error message on snapshot import in snapmgr.c
When a snapshot file fails to be read in ImportSnapshot(), it wouldissue an ERROR as "invalid snapshot identifier" when opening a streamfor it in read-only mode. This error message is reworded to be the sameas all the other messages used in this case on failure, which is usefulwhen debugging this area.Thinko introduced bybb446b6 where snapshot imports have beenadded. A backpatch down to 11 is done as this can improve any workrelated to snapshot imports in older branches.Author: Bharath RupireddyReviewed-by: Daniel GustafssonDiscussion:https://postgr.es/m/CALj2ACWmr=3KdxDkm8h7Zn1XxBoF6hdzq8WQyMn2y1OL5RYFrg@mail.gmail.comBackpatch-through: 11
1 parent800d5bc commitbe3dfd3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/backend/utils/time/snapmgr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,8 +1445,9 @@ ImportSnapshot(const char *idstr)
14451445
f=AllocateFile(path,PG_BINARY_R);
14461446
if (!f)
14471447
ereport(ERROR,
1448-
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1449-
errmsg("invalid snapshot identifier: \"%s\"",idstr)));
1448+
(errcode_for_file_access(),
1449+
errmsg("could not open file \"%s\" for reading: %m",
1450+
path)));
14501451

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp