mirror of
https://github.com/postgres/postgres.git
synced 2025-10-29 22:49:41 +03:00
Allow background workers to bypass datallowconn
THis adds a "flags" field to the BackgroundWorkerInitializeConnection() and BackgroundWorkerInitializeConnectionByOid(). For now only one flag, BGWORKER_BYPASS_ALLOWCONN, is defined, which allows the worker to ignore datallowconn.
This commit is contained in:
@@ -421,7 +421,7 @@ extern AuxProcType MyAuxProcType;
|
||||
extern void pg_split_opts(char **argv, int *argcp, const char *optstr);
|
||||
extern void InitializeMaxBackends(void);
|
||||
extern void InitPostgres(const char *in_dbname, Oid dboid, const char *username,
|
||||
Oid useroid, char *out_dbname);
|
||||
Oid useroid, char *out_dbname, bool override_allow_connections);
|
||||
extern void BaseInit(void);
|
||||
|
||||
/* in utils/init/miscinit.c */
|
||||
|
||||
@@ -140,10 +140,13 @@ extern PGDLLIMPORT BackgroundWorker *MyBgworkerEntry;
|
||||
* If dbname is NULL, connection is made to no specific database;
|
||||
* only shared catalogs can be accessed.
|
||||
*/
|
||||
extern void BackgroundWorkerInitializeConnection(const char *dbname, const char *username);
|
||||
extern void BackgroundWorkerInitializeConnection(const char *dbname, const char *username, uint32 flags);
|
||||
|
||||
/* Just like the above, but specifying database and user by OID. */
|
||||
extern void BackgroundWorkerInitializeConnectionByOid(Oid dboid, Oid useroid);
|
||||
extern void BackgroundWorkerInitializeConnectionByOid(Oid dboid, Oid useroid, uint32 flags);
|
||||
|
||||
/* Flags to BackgroundWorkerInitializeConnection et al */
|
||||
#define BGWORKER_BYPASS_ALLOWCONN 1
|
||||
|
||||
/* Block/unblock signals in a background worker process */
|
||||
extern void BackgroundWorkerBlockSignals(void);
|
||||
|
||||
Reference in New Issue
Block a user