Skip to content

Commit 2103266

Browse files
committed
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
1 parent 0829cc4 commit 2103266

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/backend/tcop/postgres.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4009,9 +4009,32 @@ PostgresSingleUserMain(int argc, char *argv[],
40094009
/* read control file (error checking and contains config ) */
40104010
LocalProcessControlFile(false);
40114011

4012+
/*
4013+
* process any libraries that should be preloaded at postmaster start
4014+
*/
4015+
process_shared_preload_libraries();
4016+
40124017
/* Initialize MaxBackends */
40134018
InitializeMaxBackends();
40144019

4020+
/*
4021+
* Give preloaded libraries a chance to request additional shared memory.
4022+
*/
4023+
process_shmem_requests();
4024+
4025+
/*
4026+
* Now that loadable modules have had their chance to request additional
4027+
* shared memory, determine the value of any runtime-computed GUCs that
4028+
* depend on the amount of shared memory required.
4029+
*/
4030+
InitializeShmemGUCs();
4031+
4032+
/*
4033+
* Now that modules have been loaded, we can process any custom resource
4034+
* managers specified in the wal_consistency_checking GUC.
4035+
*/
4036+
InitializeWalConsistencyChecking();
4037+
40154038
CreateSharedMemoryAndSemaphores();
40164039

40174040
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy