Re: Package support for Postgres - Mailing list pgsql-hackers

From Bill Studenmund
Subject Re: Package support for Postgres
Date
Msg-id Pine.NEB.4.33.0110191832550.2424-100000@vespasia.home-net.internetconnect.net
Whole thread Raw
In response to Re: Package support for Postgres  ("Rod Taylor" <rbt@barchord.com>)
List pgsql-hackers
On Sat, 20 Oct 2001, Rod Taylor wrote:

> But what if you want a C function to set a variable which can be
> accessed using an SQL, perl, PLpgSQL or other function type?
> Shouldn't a global variable be global between all types of functions?

No. Doing that requires that all languages have the same internal storage
of variables. And it's more than just an int4 takes up 4 bytes. Look in
the plpgsql source, at struct PLpgSQL_var. There is a fair amount of into
about a variable.

While we could harmonize the info storage, making globals global across
all languages would also would mean breaking down a lot of the isolation
between PLs. Right now they are their own independent entities. To tie
them together like this would, in my opinion, make them
fragilly-interconnected.

My suggestion is to just add a get and a set routine in one language, and
have it store the global. :-)

Take care,

Bill



pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: [SQL] CREATE RULE ON UPDATE/DELETE
Next
From: Bruce Momjian
Date:
Subject: snapshots now working