Re: are there static variables in pgsql? - Mailing list pgsql-general

From ptjm@interlog.com (Patrick TJ McPhee)
Subject Re: are there static variables in pgsql?
Date
Msg-id 4f49cfF1hd2uhU1@uni-berlin.de
Whole thread Raw
In response to are there static variables in pgsql?  ("Yavuz Kavus" <yavuzkavus@gmail.com>)
Responses Re: are there static variables in pgsql?  (Kenneth Downs <ken@secdat.com>)
List pgsql-general
In article <95b926fc0606101531q38cc2d6aq6c63730d4796f184@mail.gmail.com>,
Yavuz Kavus <yavuzkavus@gmail.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@interlog.com

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: TOAST not working
Next
From: Jorge Godoy
Date:
Subject: Re: delete seems to be getting blocked