Re: pl/pgsql and global variables - Mailing list pgsql-general

From Joe Conway
Subject Re: pl/pgsql and global variables
Date
Msg-id 3E943CBD.7020106@joeconway.com
Whole thread Raw
In response to pl/pgsql and global variables  ("John Lim" <heyjohnlim@yahoo.com>)
List pgsql-general
John Lim wrote:
> However we need access to global variables in PL/pgSQL. I cannot find any
> mention of this in the docs. A search on google was not helpful as it just
> pointed back at the docs. Is this feature available, or do we have to use
> some of the other available languages such as PL/TCL or PL/Python?

There are no global variables natively available to PL/pgSQL. If global
across function calls, but within one backend connection, is what you
need, it would be fairly easy to write a C function to provide the
capability and then use it from PL/pgSQL.

I don't know a great deal about PL/Tcl, PL/Perl, and PL/Python, but I
believe they all have the ability to create and reference global
variables within one backend connection. I am relatively certain none
allow globals across backends.

HTH,

Joe


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Question on initdb and subsequent start
Next
From: Dennis Gearon
Date:
Subject: Re: pl/pgsql and global variables