@@ -4148,89 +4148,6 @@ MaxLivePostmasterChildren(void)
4148
4148
max_wal_senders + max_worker_processes );
4149
4149
}
4150
4150
4151
- /*
4152
- * Connect background worker to a database.
4153
- */
4154
- void
4155
- BackgroundWorkerInitializeConnection (const char * dbname , const char * username , uint32 flags )
4156
- {
4157
- BackgroundWorker * worker = MyBgworkerEntry ;
4158
- bits32 init_flags = 0 ; /* never honor session_preload_libraries */
4159
-
4160
- /* ignore datallowconn? */
4161
- if (flags & BGWORKER_BYPASS_ALLOWCONN )
4162
- init_flags |= INIT_PG_OVERRIDE_ALLOW_CONNS ;
4163
- /* ignore rolcanlogin? */
4164
- if (flags & BGWORKER_BYPASS_ROLELOGINCHECK )
4165
- init_flags |= INIT_PG_OVERRIDE_ROLE_LOGIN ;
4166
-
4167
- /* XXX is this the right errcode? */
4168
- if (!(worker -> bgw_flags & BGWORKER_BACKEND_DATABASE_CONNECTION ))
4169
- ereport (FATAL ,
4170
- (errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
4171
- errmsg ("database connection requirement not indicated during registration" )));
4172
-
4173
- InitPostgres (dbname , InvalidOid , /* database to connect to */
4174
- username , InvalidOid , /* role to connect as */
4175
- init_flags ,
4176
- NULL ); /* no out_dbname */
4177
-
4178
- /* it had better not gotten out of "init" mode yet */
4179
- if (!IsInitProcessingMode ())
4180
- ereport (ERROR ,
4181
- (errmsg ("invalid processing mode in background worker" )));
4182
- SetProcessingMode (NormalProcessing );
4183
- }
4184
-
4185
- /*
4186
- * Connect background worker to a database using OIDs.
4187
- */
4188
- void
4189
- BackgroundWorkerInitializeConnectionByOid (Oid dboid , Oid useroid , uint32 flags )
4190
- {
4191
- BackgroundWorker * worker = MyBgworkerEntry ;
4192
- bits32 init_flags = 0 ; /* never honor session_preload_libraries */
4193
-
4194
- /* ignore datallowconn? */
4195
- if (flags & BGWORKER_BYPASS_ALLOWCONN )
4196
- init_flags |= INIT_PG_OVERRIDE_ALLOW_CONNS ;
4197
- /* ignore rolcanlogin? */
4198
- if (flags & BGWORKER_BYPASS_ROLELOGINCHECK )
4199
- init_flags |= INIT_PG_OVERRIDE_ROLE_LOGIN ;
4200
-
4201
- /* XXX is this the right errcode? */
4202
- if (!(worker -> bgw_flags & BGWORKER_BACKEND_DATABASE_CONNECTION ))
4203
- ereport (FATAL ,
4204
- (errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
4205
- errmsg ("database connection requirement not indicated during registration" )));
4206
-
4207
- InitPostgres (NULL , dboid , /* database to connect to */
4208
- NULL , useroid , /* role to connect as */
4209
- init_flags ,
4210
- NULL ); /* no out_dbname */
4211
-
4212
- /* it had better not gotten out of "init" mode yet */
4213
- if (!IsInitProcessingMode ())
4214
- ereport (ERROR ,
4215
- (errmsg ("invalid processing mode in background worker" )));
4216
- SetProcessingMode (NormalProcessing );
4217
- }
4218
-
4219
- /*
4220
- * Block/unblock signals in a background worker
4221
- */
4222
- void
4223
- BackgroundWorkerBlockSignals (void )
4224
- {
4225
- sigprocmask (SIG_SETMASK , & BlockSig , NULL );
4226
- }
4227
-
4228
- void
4229
- BackgroundWorkerUnblockSignals (void )
4230
- {
4231
- sigprocmask (SIG_SETMASK , & UnBlockSig , NULL );
4232
- }
4233
-
4234
4151
/*
4235
4152
* Start a new bgworker.
4236
4153
* Starting time conditions must have been checked already.
0 commit comments