Re: [HACKERS] livetime of a variable defined in a c-procedure (fwd)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] livetime of a variable defined in a c-procedure (fwd)
Дата
Msg-id 3827.928607583@sss.pgh.pa.us
обсуждение исходный текст
Ответ на livetime of a variable defined in a c-procedure (fwd)  ("Victoria W." <wicki@terror.de>)
Список pgsql-hackers
"Victoria W." <wicki@terror.de> writes:
> CREATE FUNCTION add_rechnr(int4) RETURNS int4
>               AS '/usr/local/pgsql/lib/modules/funcs.so' LANGUAGE 'c';

> whenever I add a value to rechnr, the correct result is returned. but if I
> copy a new file "funcs.so" into the direcotry while the backend is
> running and a connection is established, I'll get this error:

> pqReadData() -- backend closed the channel unexpectedly.

Overwriting a shared library that's in active use is a no-no on many
flavors of Unix.  (The one I use won't even let you do it --- you get
a "text file busy" error if you try to delete or modify an open SL.)

I don't think there is an "unload shared library" function in Postgres
(it'd be hard or impossible to implement on some Unixes, anyway).  So
the only way to stop referencing a shared library once it's been opened
is to terminate the backend process.

In short, if you've designed a solution that requires you to constantly
modify the shared library, you'd better look for another solution ---
or accept a lot of backend restarts.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Priorities for 6.6
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: [PATCHES] Re: contrib code for 6.5