Requests the ability to establish a database connection through which it can later run transactions and queries. (Typically, the string for bgw_name will contain the type somehow, but that is not strictly required.)īgw_flags is a bitwise-or'd bit mask indicating the capabilities that the module wants. bgw_name on the other hand can contain additional information about the specific process. bgw_type should be the same for all background workers of the same type, so that it is possible to group such workers in a process listing, for example. Int bgw_restart_time /* in seconds, or BGW_NEVER_RESTART */īgw_name and bgw_type are strings to be used in log messages, process listings and similar contexts. Typedef void (*bgworker_main_type)(Datum main_arg) The structure BackgroundWorker is defined thus: Unlike RegisterBackgroundWorker, which can only be called from within the postmaster process, RegisterDynamicBackgroundWorker must be called from a regular backend or another background worker. Background workers can also be started after the system is up and running by calling RegisterDynamicBackgroundWorker( BackgroundWorker * worker, BackgroundWorkerHandle ** handle). A module wishing to run a background worker can register it by calling RegisterBackgroundWorker( BackgroundWorker * worker) from its _PG_init() function. Only carefully audited modules should be permitted to run background worker processes.īackground workers can be initialized at the time that PostgreSQL is started by including the module name in shared_preload_libraries. Administrators wishing to enable modules that include background worker processes should exercise extreme caution. There are considerable robustness and security risks in using background worker processes because, being written in the C language, they have unrestricted access to data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |