1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-06 18:42:54 +03:00

Add a note to the documentation of pg_standby that it's important that

the postgres process has permissions to delete the trigger file, per
suggestion by Mason Hale.

Also fix pg_standby to do a more predictable exit(200) instead of the
current exit(-1) when the unlink of the trigger file fails anyway.

This only affects 8.3 branch. Older versions didn't have pg_standby,
and in 8.4 upwards pg_standby is no longer responsible for deleting the
trigger file; it's supposed to be done by recovery_end_command instead.
This commit is contained in:
Heikki Linnakangas
2010-02-05 11:08:02 +00:00
parent d76c491cb9
commit a085a6a77c
2 changed files with 14 additions and 2 deletions

View File

@@ -371,13 +371,16 @@ CheckForExternalTrigger(void)
* recovery completes, we will be asked again for the same file from
* the archive using pg_standby so must remove trigger file so we can
* reload file again and come up correctly.
*
* If it fails, return with an exit code that the server will treat
* as a FATAL error.
*/
rc = unlink(triggerPath);
if (rc != 0)
{
fprintf(stderr, "\n ERROR: could not remove \"%s\": %s", triggerPath, strerror(errno));
fflush(stderr);
exit(rc);
exit(200);
}
return true;
}