diff --git a/src/main/main.c b/src/main/main.c index c463b0f3e..1c83cef70 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -656,7 +656,7 @@ write_pid_file(void) pool_config->pid_file_name))); } - fd = open(pid_file, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); + fd = open(pid_file, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); if (fd == -1) { ereport(FATAL,