diff options
author | Robert Haas | 2015-02-02 21:23:59 +0000 |
---|---|---|
committer | Robert Haas | 2015-02-02 21:23:59 +0000 |
commit | 5d2f957f3f9dcd88384780876f535b423151f9bf (patch) | |
tree | a857f045f8bc849ef6cb3aca570e7252e74a324b /doc/src | |
parent | 2488eff889f83d7d6411be9a6172ff69df3f0085 (diff) |
Add new function BackgroundWorkerInitializeConnectionByOid.
Sometimes it's useful for a background worker to be able to initialize
its database connection by OID rather than by name, so provide a way
to do that.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/bgworker.sgml | 17 |
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> |