Refactor InitPostgres() to use bitwise option flags
commit4800a5dfb4c46d22b5d05f16c615bea6ff24a2bb
authorMichael Paquier <michael@paquier.xyz>
Wed, 11 Oct 2023 03:31:49 +0000 (11 12:31 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 11 Oct 2023 03:31:49 +0000 (11 12:31 +0900)
tree14c19eaa27346ac68387dfe3197724330a9cea6f
parent28139037c06df7225aef189f95a8425d7990be26
Refactor InitPostgres() to use bitwise option flags

InitPostgres() has been using a set of boolean arguments to control its
behavior, and a patch under discussion was aiming at expanding it with a
third one.  In preparation for expanding this area, this commit switches
all the current boolean arguments of this routine to a single bits32
argument instead.  Two values are currently supported for the flags:
- INIT_PG_LOAD_SESSION_LIBS to load [session|local]_preload_libraries at
startup.
- INIT_PG_OVERRIDE_ALLOW_CONNS to allow connection to a database even if
it has !datallowconn.  This is used by bgworkers.

Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/ZSTn66_BXRZCeaqS@paquier.xyz
src/backend/bootstrap/bootstrap.c
src/backend/postmaster/autovacuum.c
src/backend/postmaster/postmaster.c
src/backend/tcop/postgres.c
src/backend/utils/init/postinit.c
src/include/miscadmin.h