Re: Package support for Postgres

From: Bill Studenmund <wrstuden(at)netbsd(dot)org>
To: Rod Taylor <rbt(at)barchord(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Package support for Postgres
Date: 2001-10-20 01:40:04
Message-ID: Pine.NEB.4.33.0110191832550.2424-100000@vespasia.home-net.internetconnect.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-10-20 02:42:10 Re: To Postgres Devs : Wouldn't changing the select limit
Previous Message Thomas Lockhart 2001-10-20 01:10:01 Re: Platform dependency in timestamp parsing