aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2022-07-15 12:24:10 -0700
committerJeff Davis <jdavis@postgresql.org>2022-07-20 09:37:00 -0700
commit2103266a360df688062c4188f1de074b957fd6e9 (patch)
tree55c1dc4814d79b8177dd9fbaeeea16e56375ebda /src/backend/tcop/postgres.c
parent0829cc43ed69252184f90161b4940444d8b48574 (diff)
downloadpostgresql-2103266a360df688062c4188f1de074b957fd6e9.tar.gz
postgresql-2103266a360df688062c4188f1de074b957fd6e9.zip
Process shared_preload_libraries in single-user mode.
Without processing shared_preload_libraries, it's impossible to recover if custom WAL resource managers are needed. It may also pose a problem running VACUUM on a table with a custom AM, if the module implementing the AM is expecting to be loaded by shared_preload_libraries. The reason this wasn't done before was just the general principle to do fewer things in single-user mode. But it's easy enough to just set shared_preload_libraries to empty, for the same effect. Discussion: https://postgr.es/m/9decc18a42634f8a2f15c97a385a0f51a752f396.camel%40j-davis.com Reviewed-by: Tom Lane, Andres Freund Backpatch-through: 15
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index cbce480eab2..b21adebf382 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -4009,9 +4009,32 @@ PostgresSingleUserMain(int argc, char *argv[],
/* read control file (error checking and contains config ) */
LocalProcessControlFile(false);
+ /*
+ * process any libraries that should be preloaded at postmaster start
+ */
+ process_shared_preload_libraries();
+
/* Initialize MaxBackends */
InitializeMaxBackends();
+ /*
+ * Give preloaded libraries a chance to request additional shared memory.
+ */
+ process_shmem_requests();
+
+ /*
+ * Now that loadable modules have had their chance to request additional
+ * shared memory, determine the value of any runtime-computed GUCs that
+ * depend on the amount of shared memory required.
+ */
+ InitializeShmemGUCs();
+
+ /*
+ * Now that modules have been loaded, we can process any custom resource
+ * managers specified in the wal_consistency_checking GUC.
+ */
+ InitializeWalConsistencyChecking();
+
CreateSharedMemoryAndSemaphores();
/*