Refactor InitPostgres() to use bitwise option flags
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/bootstrap/bootstrap.c | modified | +1 −1 |
| src/backend/postmaster/autovacuum.c | modified | +2 −3 |
| src/backend/postmaster/postmaster.c | modified | +12 −4 |
| src/backend/tcop/postgres.c | modified | +3 −2 |
| src/backend/utils/init/postinit.c | modified | +9 −8 |
| src/include/miscadmin.h | modified | +4 −2 |
Discussion
- Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag 41 messages · 2023-09-28 → 2023-10-16