Re: are there static variables in pgsql?

From: ptjm(at)interlog(dot)com (Patrick TJ McPhee)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: are there static variables in pgsql?
Date: 2006-06-12 04:37:36
Message-ID: 4f49cfF1hd2uhU1@uni-berlin.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In article <95b926fc0606101531q38cc2d6aq6c63730d4796f184(at)mail(dot)gmail(dot)com>,
Yavuz Kavus <yavuzkavus(at)gmail(dot)com> wrote:

% i am writing a recursive procedure in pl/pgsql.
% i need to check whether a condition is true in any step of recursive calls.

[...]

% i think i may achieve this with a static variable(shared among all calls).

I'm not sure a static variable is the right way to achieve this, but
you could use a custom_variable_class for this. Add this to your
postgresql.conf:
custom_variable_classes='global'

Then you can set and show variables prefixed by global.:
set global.success = 'true';

--

Patrick TJ McPhee
North York Canada
ptjm(at)interlog(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2006-06-12 05:01:53 Re: can i use a string in where clause such as "id in (str)"
Previous Message Greg Sabino Mullane 2006-06-12 02:52:22 GnuPG / PGP signed checksums for PostgreSQL 8.1.4, 8.0.8, 7.4.13, and 7.3.15