Re: static variables in functions

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Gyozo Papp <pgerzson(at)freestart(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: static variables in functions
Date: 2001-04-20 08:49:53
Message-ID: 20010420104953.A24534@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michaël Fiey 2001-04-20 09:02:52 Database Connect
Previous Message Gyozo Papp 2001-04-20 08:35:36 static variables in functions