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

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Would a BGW need shmem_access or database_connection to enumerate databases?
Дата
Msg-id CAMsr+YGWSfetkTh8o7P-5jVx3H1Nk9fyV-BbcqX_v8vR2eHnPA@mail.gmail.com
обсуждение исходный текст
Ответ на Would a BGW need shmem_access or database_connection to enumeratedatabases?  (Chapman Flack <chap@anastigmatix.net>)
Список pgsql-hackers
On 30 November 2017 at 06:48, 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. > > For the "master" one, what capabilities will it need to simply > enumerate the current names of known databases? I suppose I could > have it connect to the null dbname and query pg_database. Would > that be the civilized way to do it, or am I missing a simpler way? > pglogical does exactly this. Take a look at start_manager_workers in pglogical.c https://github.com/2ndQuadrant/pglogical/blob/REL2_x_STABLE/pglogical.c#L594 and the caller pglogical_supervisor_main . -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Oliver Ford
Дата:
Сообщение: Add GROUPS option to the Window Functions
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Would a BGW need shmem_access or database_connection to enumerate databases?