Re: dynamic loading of c-functions

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: dynamic loading of c-functions
Дата
Msg-id 20050721183005.GF25926@svana.org
обсуждение исходный текст
Ответ на dynamic loading of c-functions  ("TJ O'Donnell" <tjo@acm.org>)
Список pgsql-general
On Thu, Jul 21, 2005 at 10:40:21AM -0700, TJ O'Donnell wrote:
> It is clear from the manual that c-functions can cause the dynamic loading
> of .so's and that subsequent usage in the same database session will use
> the already loaded function.  But, when the session is done, will the loaded
> function remain in the server for subsequent sessions?
> When/how does a dynamically loaded .so get unloaded?
> I want to avoid preloading .so's at server startup, but also avoid dynamically
> loading them for ~every~ session.

PostgreSQL uses multiple process, so when you close your connection it
releases the address space, including the loaded library. There's no
way to preserve across multiple connections.

The two options are:
- Load at server startup, then they're ready to go as soon as you
connect.  preload_libraries option.
- Dynamic loading when you use the function. Default option.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

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

Предыдущее
От: "TJ O'Donnell"
Дата:
Сообщение: dynamic loading of c-functions
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Converting MySQL tinyint to PostgreSQL