Skip to content

Commit 9319f8e

Browse files
jeff-davismy-ship-it
authored andcommitted
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 (cherry picked from commit 6c31ac0)
1 parent 735d6a4 commit 9319f8e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/backend/tcop/postgres.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5044,8 +5044,19 @@ PostgresMain(int argc, char *argv[],
50445044
/* read control file (error checking and contains config ) */
50455045
LocalProcessControlFile(false);
50465046

5047+
/*
5048+
* process any libraries that should be preloaded at postmaster start
5049+
*/
5050+
process_shared_preload_libraries();
5051+
50475052
/* Initialize MaxBackends (if under postmaster, was done already) */
50485053
InitializeMaxBackends();
5054+
5055+
/*
5056+
* Now that modules have been loaded, we can process any custom resource
5057+
* managers specified in the wal_consistency_checking GUC.
5058+
*/
5059+
InitializeWalConsistencyChecking();
50495060
}
50505061

50515062
/* Early initialization */

0 commit comments

Comments
 (0)