Re: global variables in plpgsql?

Lists: pgsql-sql
From: dave(dot)bath(at)unix(dot)net
To: pgsql-sql(at)postgresql(dot)org
Subject: global variables in plpgsql?
Date: 2006-04-11 01:17:03
Message-ID: 200604111117.04425.dave.bath@unix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Folks,

In v8.0.3 documentation, plperl, plpython and pltcl allow declaration of
variables that are global and persistent within a session.

begin_quote
37.4. Global Values in PL/Perl
You can use the global hash %_SHARED to store data, including code references,
between function calls for the lifetime of the current session.
end_quote

So, a couple of questions....
1) Can you declare global values from plpgsql?
2) If so, is there a way of avoiding namespace pollution?
(perhaps the equivalent to Oracle's use of plsql package
variables)

tia
--
David T. Bath
dave(dot)bath(at)unix(dot)net


From: John DeSoi <desoi(at)pgedit(dot)com>
To: dave(dot)bath(at)unix(dot)net
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: global variables in plpgsql?
Date: 2006-04-11 05:15:37
Message-ID: F5F6CA70-2C8C-4786-8333-B2C86CF3FFA6@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql


On Apr 10, 2006, at 9:17 PM, dave(dot)bath(at)unix(dot)net wrote:

> So, a couple of questions....
> 1) Can you declare global values from plpgsql?
> 2) If so, is there a way of avoiding namespace pollution?
> (perhaps the equivalent to Oracle's use of plsql package
> variables)

plpgsql does not have global variables.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL