On 19 September 2017 at 18:04, Petr Jelinek <petr.jeli...@2ndquadrant.com> wrote:
> > If you are asking why they are not identified by the > BackgroundWorkerHandle, then it's because it's private struct and can't > be shared with other processes so there is no way to link the logical > worker info with bgworker directly. I really want BackgroundWorkerHandle to be public, strong +1 from me. It'd be very beneficial when working with shm_mq, too. Right now you cannot pass a BackgroundWorkerHandle through shmem to another process, either via a static shmem region or via shm_mq. This means you can't supply it to shm_mq_attach and have shm_mq handle lifetime issues for you based on the worker handle. TBH I think there's a fair bit of work needed in the bgworker infrastructure, but making BackgroundWorkerHandle public is a small and simple start that'd be a big help. At some point we'll also want to be able to enumerate background workers and get handles for existing workers. Also, let background workers recover from errors without exiting, which means factoring a bunch of stuff out of PostgresMain. But both of those are bigger jobs. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services