Re: static variables in functions

Поиск
Список
Период
Сортировка
От Karel Zak
Тема Re: static variables in functions
Дата
Msg-id 20010420104953.A24534@ara.zf.jcu.cz
обсуждение исходный текст
Ответ на static variables in functions  ("Gyozo Papp" <pgerzson@freestart.hu>)
Список pgsql-general
On Fri, Apr 20, 2001 at 10:35:36AM +0200, Gyozo Papp wrote:
> hello everyone,
>
> is there any possibility to keep the value of an arbitrary type variable in a plpgsql function between its
invocations?
> If not, can it be made with functions written in C instead? I've "static storage" in my mind.
> Can it be made thread-safe?

 The PG backend isn't multi-thread program. You can use "static", if you
sure what you do :-) If you allocate it you must be sure if you use some
persisten memory context or you can use native malloc(), ..etc.

 Or is possible define arbitrary function as cacheable.

                Karel


--
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

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

Предыдущее
От: Grzegorz Mucha
Дата:
Сообщение: Re: Re: Latin2 and Unicode problems
Следующее
От: Michaël Fiey
Дата:
Сообщение: Database Connect