File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818#include "keeper_config.h"
1919#include "lock_utils.h"
2020#include "string_utils.h"
21+ #if (PG_VERSION_NUM >= 120000 )
22+ #include "common/logging.h"
23+ #endif
2124
2225char pg_autoctl_argv0 [MAXPGPATH ];
2326char pg_autoctl_program [MAXPGPATH ];
@@ -48,6 +51,16 @@ main(int argc, char **argv)
4851 /* set our logging infrastructure */
4952 (void ) set_logger ();
5053
54+ /*
55+ * Since PG 12, we need to call pg_logging_init before any calls to pg_log_*
56+ * otherwise, we get a segfault. Although we don't use pg_log_* directly,
57+ * functions from the common library such as rmtree do use them.
58+ * Logging change introduced in PG 12: https://git.postgresql.org/cgit/postgresql.git/commit/?id=cc8d41511721d25d557fc02a46c053c0a602fed0
59+ */
60+ #if (PG_VERSION_NUM >= 120000 )
61+ pg_logging_init (argv [0 ]);
62+ #endif
63+
5164 /* register our logging clean-up atexit */
5265 atexit (log_semaphore_unlink_atexit );
5366
You can’t perform that action at this time.
0 commit comments