Re: persistent variables between cross-calls in C functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "ff" <ff-(at)uol(dot)com(dot)br>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: persistent variables between cross-calls in C functions
Date: 2003-03-22 05:20:21
Message-ID: 27885.1048310421@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

"ff" <ff-(at)uol(dot)com(dot)br> writes:
> I could not find any way to store a value in a C function
> between calls.

A static variable such as you illustrated should work fine --- at least
for successive calls within a single session. It will not provide
communications across sessions. For that you'd need to use a file or
grab some shared memory (this is doable but bear in mind that it's a
very finite resource).

regards, tom lane

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2003-03-22 10:33:30 Re: embedded sql interface to ip address type
Previous Message Rob Fowler 2003-03-22 02:27:41 Re: embedded sql interface to ip address type