aboutsummaryrefslogtreecommitdiff
path: root/src/include/miscadmin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/miscadmin.h')
-rw-r--r--src/include/miscadmin.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 382a5deced4..aa8cce5ca81 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -348,11 +348,35 @@ extern PGDLLIMPORT bool process_shared_preload_libraries_in_progress;
extern char *shared_preload_libraries_string;
extern char *local_preload_libraries_string;
-#define LOCK_FILE_LINES 7
+/*
+ * As of 9.1, the contents of the data-directory lock file are:
+ *
+ * line #
+ * 1 postmaster PID (or negative of a standalone backend's PID)
+ * 2 data directory path
+ * 3 postmaster start timestamp (time_t representation)
+ * 4 port number
+ * 5 socket directory path (empty on Windows)
+ * 6 first listen_address (IP address or "*"; empty if no TCP port)
+ * 7 shared memory key (not present on Windows)
+ *
+ * Lines 6 and up are added via AddToDataDirLockFile() after initial file
+ * creation; they have to be ordered according to time of addition.
+ *
+ * The socket lock file, if used, has the same contents as lines 1-5.
+ */
+#define LOCK_FILE_LINE_PID 1
+#define LOCK_FILE_LINE_DATA_DIR 2
+#define LOCK_FILE_LINE_START_TIME 3
+#define LOCK_FILE_LINE_PORT 4
+#define LOCK_FILE_LINE_SOCKET_DIR 5
+#define LOCK_FILE_LINE_LISTEN_ADDR 6
+#define LOCK_FILE_LINE_SHMEM_KEY 7
+
extern void CreateDataDirLockFile(bool amPostmaster);
extern void CreateSocketLockFile(const char *socketfile, bool amPostmaster);
extern void TouchSocketLockFile(void);
-extern void AddToLockFile(int target_line, const char *str);
+extern void AddToDataDirLockFile(int target_line, const char *str);
extern void ValidatePgVersion(const char *path);
extern void process_shared_preload_libraries(void);
extern void process_local_preload_libraries(void);