From: | Craig Ringer <craig(at)2ndquadrant(dot)com> |
---|---|
To: | Chapman Flack <chap(at)anastigmatix(dot)net> |
Cc: | 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-04 14:13:56 |
Message-ID: | CAMsr+YEPWFyYujbLsV-3p8jdQs+nsjmZc6SAaqbM_Ra1na-Jrg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 1 December 2017 at 23:04, Chapman Flack <chap(at)anastigmatix(dot)net> wrote:
> 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?
>
Yes. BDR does it a lot.
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2017-12-04 14:51:48 | Re: BUG #14941: Vacuum crashes |
Previous Message | Craig Ringer | 2017-12-04 14:12:55 | Re: Would a BGW need shmem_access or database_connection to enumerate databases? |