summaryrefslogtreecommitdiff
path: root/src/common/controldata_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/controldata_utils.c')
-rw-r--r--src/common/controldata_utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/controldata_utils.c b/src/common/controldata_utils.c
index 7d4af7881ea..4ce097c05ce 100644
--- a/src/common/controldata_utils.c
+++ b/src/common/controldata_utils.c
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <time.h>
#include "access/xlog_internal.h"
#include "catalog/pg_control.h"
@@ -168,6 +169,9 @@ update_controlfile(const char *DataDir,
StaticAssertStmt(sizeof(ControlFileData) <= PG_CONTROL_FILE_SIZE,
"sizeof(ControlFileData) exceeds PG_CONTROL_FILE_SIZE");
+ /* Update timestamp */
+ ControlFile->time = (pg_time_t) time(NULL);
+
/* Recalculate CRC of control file */
INIT_CRC32C(ControlFile->crc);
COMP_CRC32C(ControlFile->crc,