Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group