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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Would a BGW need shmem_access or database_connection to enumerate databases?
Дата
Msg-id CAB7nPqTdi=J9HH8PPPiEOohebdd+xkgbbhdY7=VbGnZ3CkZXxA@mail.gmail.com
обсуждение исходный текст
Ответ на Would a BGW need shmem_access or database_connection to enumeratedatabases?  (Chapman Flack <chap@anastigmatix.net>)
Ответы Re: Would a BGW need shmem_access or database_connection to enumeratedatabases?
Список pgsql-hackers
On Thu, Nov 30, 2017 at 7:48 AM, Chapman Flack <chap@anastigmatix.net> wrote:
> 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?

Yes. That's actually what the autovacuum launcher does. It connects
using InitPostgres(NULL, InvalidOid, NULL, NULL), and then scans
pg_database to fetch a list (see get_database_list).
-- 
Michael


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] Refactoring identifier checks to consistently use strcmp
Следующее
От: Chapman Flack
Дата:
Сообщение: Re: Would a BGW need shmem_access or database_connection to enumeratedatabases?