summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/bgworker.sgml17
1 files changed, 10 insertions, 7 deletions
diff --git a/doc/src/sgml/bgworker.sgml b/doc/src/sgml/bgworker.sgml
index 8e218ac0406..ef28f725114 100644
--- a/doc/src/sgml/bgworker.sgml
+++ b/doc/src/sgml/bgworker.sgml
@@ -146,14 +146,17 @@ typedef struct BackgroundWorker
</para>
<para>Once running, the process can connect to a database by calling
- <function>BackgroundWorkerInitializeConnection(<parameter>char *dbname</parameter>, <parameter>char *username</parameter>)</function>.
+ <function>BackgroundWorkerInitializeConnection(<parameter>char *dbname</parameter>, <parameter>char *username</parameter>)</function> or
+ <function>BackgroundWorkerInitializeConnectionByOid(<parameter>Oid dboid</parameter>, <parameter>Oid useroid</parameter>)</function>.
This allows the process to run transactions and queries using the
- <literal>SPI</literal> interface. If <varname>dbname</> is NULL,
- the session is not connected to any particular database, but shared catalogs
- can be accessed. If <varname>username</> is NULL, the process will run as
- the superuser created during <command>initdb</>.
- BackgroundWorkerInitializeConnection can only be called once per background
- process, it is not possible to switch databases.
+ <literal>SPI</literal> interface. If <varname>dbname</> is NULL or
+ <varname>dboid</> is <literal>InvalidOid</>, the session is not connected
+ to any particular database, but shared catalogs can be accessed.
+ If <varname>username</> is NULL or <varname>useroid</> is
+ <literal>InvalidOid</>, the process will run as the superuser created
+ during <command>initdb</>.
+ A background worker can only call one of these two functions, and only
+ once. It is not possible to switch databases.
</para>
<para>