mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-03 08:00:21 +08:00
Add logging to /contrib/pg_standby if -k couldn't clean up the log file.
Darcy Buskermolen
This commit is contained in:
parent
e52c4a6e26
commit
053981f405
@ -264,10 +264,15 @@ CustomizableCleanupPriorWALFiles(void)
|
|||||||
#else
|
#else
|
||||||
snprintf(WALFilePath, MAXPGPATH, "%s/%s", archiveLocation, xlde->d_name);
|
snprintf(WALFilePath, MAXPGPATH, "%s/%s", archiveLocation, xlde->d_name);
|
||||||
#endif
|
#endif
|
||||||
rc = unlink(WALFilePath);
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
fprintf(stderr, "\npg_standby: removed \"%s\"\n", WALFilePath);
|
fprintf(stderr, "\npg_standby: removing \"%s\"\n", WALFilePath);
|
||||||
|
|
||||||
|
rc = unlink(WALFilePath);
|
||||||
|
if (rc !=0 )
|
||||||
|
fprintf(stderr, "\npg_standby: ERROR failed to remove \"%s\" because %s\n", WALFilePath, strerror(errno));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -315,7 +320,7 @@ CheckForExternalTrigger(void)
|
|||||||
rc = unlink(triggerPath);
|
rc = unlink(triggerPath);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "\n ERROR: unable to remove \"%s\", rc=%d", triggerPath, rc);
|
fprintf(stderr, "\n ERROR: unable to remove \"%s\", because %s", triggerPath, strerror(errno));
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
exit(rc);
|
exit(rc);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user