Re: pl/pgsql and global variables

From: Joe Conway <mail(at)joeconway(dot)com>
To: John Lim <heyjohnlim(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pl/pgsql and global variables
Date: 2003-04-09 15:31:09
Message-ID: 3E943CBD.7020106@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-04-09 15:34:58 Re: pl/pgsql and global variables
Previous Message Tom Lane 2003-04-09 15:25:30 Re: Question on initdb and subsequent start