Re: [HACKERS] Is there any way to access heap_open() from _PG_init ??

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Is there any way to access heap_open() from _PG_init ??
Дата
Msg-id 18569.1494599458@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [HACKERS] Is there any way to access heap_open() from _PG_init ??  (Sairam Gaddam <gaddamsairam@gmail.com>)
Список pgsql-hackers
Sairam Gaddam <gaddamsairam@gmail.com> writes:
> During startup (_PG_init), I need to access some meta info of
> table/relation (like PK Column Position, FK Column Positions, Index Column
> Positions etc...) and load it into memory.

Why not fetch that info at first use, instead?

If you insist on doing it at _PG_init, you'll never be able to make the
extension work as a shared_preload_libraries item, where _PG_init
would be run in the postmaster.  (I think local_preload_libraries would
be problematic too; not sure that you're inside a transaction there.)
You won't be able to retry after an error, or more generally to cope with
post-load-time changes in the data you want to cache.

It's probably possible to make it work as long as the library gets loaded
during a transaction, ie in response to some SQL command.  Without seeing
your code we can't guess why its crashing though.
        regards, tom lane



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] [BUGS] Concurrent ALTER SEQUENCE RESTART Regression