Re: Package support for Postgres

Поиск
Список
Период
Сортировка
От Bill Studenmund
Тема Re: Package support for Postgres
Дата
Msg-id Pine.NEB.4.33.0110191832550.2424-100000@vespasia.home-net.internetconnect.net
обсуждение исходный текст
Ответ на Re: Package support for Postgres  ("Rod Taylor" <rbt@barchord.com>)
Список 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 по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: [SQL] CREATE RULE ON UPDATE/DELETE
Следующее
От: Bruce Momjian
Дата:
Сообщение: snapshots now working