aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/replication/basebackup.c2
-rw-r--r--src/backend/replication/slot.c17
2 files changed, 9 insertions, 10 deletions
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c
index 3f1eae38a92..91ae4489552 100644
--- a/src/backend/replication/basebackup.c
+++ b/src/backend/replication/basebackup.c
@@ -333,7 +333,7 @@ perform_base_backup(basebackup_options *opt)
if (lstat(XLOG_CONTROL_FILE, &statbuf) != 0)
ereport(ERROR,
(errcode_for_file_access(),
- errmsg("could not stat control file \"%s\": %m",
+ errmsg("could not stat file \"%s\": %m",
XLOG_CONTROL_FILE)));
sendFile(XLOG_CONTROL_FILE, XLOG_CONTROL_FILE, &statbuf, false);
}
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index cb781e6e9a3..800ca144882 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -628,8 +628,7 @@ ReplicationSlotDropPtr(ReplicationSlot *slot)
*/
if (!rmtree(tmppath, true))
ereport(WARNING,
- (errcode_for_file_access(),
- errmsg("could not remove directory \"%s\"", tmppath)));
+ (errmsg("could not remove directory \"%s\"", tmppath)));
/*
* We release this at the very end, so that nobody starts trying to create
@@ -1132,8 +1131,8 @@ StartupReplicationSlots(void)
if (!rmtree(path, true))
{
ereport(WARNING,
- (errcode_for_file_access(),
- errmsg("could not remove directory \"%s\"", path)));
+ (errmsg("could not remove directory \"%s\"",
+ path)));
continue;
}
fsync_fname("pg_replslot", true);
@@ -1432,21 +1431,21 @@ RestoreSlotFromDisk(const char *name)
/* verify magic */
if (cp.magic != SLOT_MAGIC)
ereport(PANIC,
- (errcode_for_file_access(),
+ (errcode(ERRCODE_DATA_CORRUPTED),
errmsg("replication slot file \"%s\" has wrong magic number: %u instead of %u",
path, cp.magic, SLOT_MAGIC)));
/* verify version */
if (cp.version != SLOT_VERSION)
ereport(PANIC,
- (errcode_for_file_access(),
+ (errcode(ERRCODE_DATA_CORRUPTED),
errmsg("replication slot file \"%s\" has unsupported version %u",
path, cp.version)));
/* boundary check on length */
if (cp.length != ReplicationSlotOnDiskV2Size)
ereport(PANIC,
- (errcode_for_file_access(),
+ (errcode(ERRCODE_DATA_CORRUPTED),
errmsg("replication slot file \"%s\" has corrupted length %u",
path, cp.length)));
@@ -1496,8 +1495,8 @@ RestoreSlotFromDisk(const char *name)
if (!rmtree(slotdir, true))
{
ereport(WARNING,
- (errcode_for_file_access(),
- errmsg("could not remove directory \"%s\"", slotdir)));
+ (errmsg("could not remove directory \"%s\"",
+ slotdir)));
}
fsync_fname("pg_replslot", true);
return;