Re: Would a BGW need shmem_access or database_connection to enumerate databases?

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Would a BGW need shmem_access or database_connection to enumerate databases?
Date: 2017-12-01 15:04:26
Message-ID: 73e2a806-08df-d4ad-c51f-f46f8d349f5f@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/29/2017 05:48 PM, Chapman Flack wrote:
> I'm thinking of writing a background worker that will enumerate
> the databases present, and spin off, for each one, another BGW
> that will establish a connection and do stuff.

Can I even do this?

"Unlike RegisterBackgroundWorker, which can only be called
from within the postmaster, RegisterDynamicBackgroundWorker
must be called from a regular backend."

Can I call RegisterDynamicBackgroundWorker when not in the postmaster,
but also not in a "regular backend", but rather another BGW?

Put another way, can a BGW be regarded as a "regular backend" for the
purpose of this rule?

-Chap

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-12-01 15:07:16 Re: Use of uninitialized variables in ExecFindPartition() for parent partition without leaves (HEAD only)
Previous Message Peter Eisentraut 2017-12-01 14:55:03 Re: Allowing SSL connection of v11 client to v10 server with SCRAM channel binding