Re: static variables in functions - Mailing list pgsql-general

From Karel Zak
Subject Re: static variables in functions
Date
Msg-id 20010420104953.A24534@ara.zf.jcu.cz
Whole thread Raw
In response to static variables in functions  ("Gyozo Papp" <pgerzson@freestart.hu>)
List 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 by date:

Previous
From: Grzegorz Mucha
Date:
Subject: Re: Re: Latin2 and Unicode problems
Next
From: Michaël Fiey
Date:
Subject: Database Connect