Re: are there static variables in pgsql?

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Terry Lee Tucker <terry(at)esc1(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: are there static variables in pgsql?
Date: 2006-06-11 02:14:40
Message-ID: 20060611021440.GD83625@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jun 10, 2006 at 06:37:35PM -0400, Terry Lee Tucker wrote:
> On Saturday 10 June 2006 06:31 pm, "Yavuz Kavus" <yavuzkavus(at)gmail(dot)com> thus
> communicated:
> --> i am writing a recursive procedure in pl/pgsql.
> --> i need to check whether a condition is true in any step of recursive
> calls. -->
> --> if i get a true response in one call, i wont make other recursive calls
> --> anymore, because i get what i need.
> --> if no one gives me a true response, then uppest procedure will return
> false --> as a result.
> -->
> --> i think i may achieve this with a static variable(shared among all
> calls). -->
> --> is it possible?
> -->
> --> or another solution?
> -->
> --> thanks a lot for any help.
> -->
> I don't know of any static variable capability; however, I use various utility
> tables to accomplish this type of task. You can insert records into a table
> like this while inside a transaction and the current process will be the only
> process that can see it. When you are through with it, delete the record, all
> within the same transaction, and your purpose will be served.

If you use a temp table for that, you can have it truncate on
commit/rollback.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Angus Berry 2006-06-11 02:43:02 Re: TOAST not working
Previous Message Jim C. Nasby 2006-06-11 02:12:15 Re: [GENERAL] TOAST not working