Re: Regarding extension

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Regarding extension
Дата
Msg-id 17058.1570166272@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Regarding extension  (Natarajan R <nataraj3098@gmail.com>)
Ответы Re: Regarding extension  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
Natarajan R <nataraj3098@gmail.com> writes:
> Me:  Thanks Tomas, But this is for that particular database only, I want
> to get the *list of database Id's* on which my extension is installed
> during *PG_INIT* itself...

You can't.  In the first place, that information simply isn't obtainable,
because a session running within one database doesn't have access to the
catalogs of other databases in the cluster.  (You could perhaps imagine
firing up connections to other DBs a la dblink/postgres_fdw, but that will
fail because you won't necessarily have permissions to connect to every
database.)  In the second place, it's a pretty terrible design to be
attempting any sort of database access within _PG_init, because that
precludes loading that module outside a transaction; for example you
will not be able to preload it via shared_preload_libraries or allied
features.

We should back up about three steps and ask why you think you need
to do this.  Generally speaking, database code shouldn't be concerning
itself with what is happening in other databases.

            regards, tom lane



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: [HACKERS] Block level parallel vacuum
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [HACKERS] Block level parallel vacuum