From 9cad926eb876a30d58a5b39789098da83a6ef91c Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sun, 22 Apr 2018 14:03:36 +0200 Subject: [PATCH] Add missing documentation for BGWORKER_BYPASS_ALLOWCONN This was missed in eed1ce72e1593d3e8b7461d7744808d4d6bf402b. Reported by Michael Paquier --- doc/src/sgml/bgworker.sgml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/bgworker.sgml b/doc/src/sgml/bgworker.sgml index ac71fb2c41..bc5a52584b 100644 --- a/doc/src/sgml/bgworker.sgml +++ b/doc/src/sgml/bgworker.sgml @@ -189,15 +189,17 @@ typedef struct BackgroundWorker Once running, the process can connect to a database by calling - BackgroundWorkerInitializeConnection(char *dbname, char *username) or - BackgroundWorkerInitializeConnectionByOid(Oid dboid, Oid useroid). + BackgroundWorkerInitializeConnection(char *dbname, char *username, uint32 flags) or + BackgroundWorkerInitializeConnectionByOid(Oid dboid, Oid useroid, uint32 flags). This allows the process to run transactions and queries using the SPI interface. If dbname is NULL or dboid is InvalidOid, the session is not connected to any particular database, but shared catalogs can be accessed. If username is NULL or useroid is InvalidOid, the process will run as the superuser created - during initdb. + during initdb. If BGWORKER_BYPASS_ALLOWCONN + is specified as flags it is possible to bypass the restriction + to connect to databases not allowing user connections. A background worker can only call one of these two functions, and only once. It is not possible to switch databases.