Re: Plperl functions with OUT parameters crashing each other when used in the same connection
В списке pgsql-general по дате отправления:
| От | Randall Lucas |
|---|---|
| Тема | Re: Plperl functions with OUT parameters crashing each other when used in the same connection |
| Дата | |
| Msg-id | 20060905050315.GE8397@ontology.tercent.com обсуждение |
| Ответ на | Re: Plperl functions with OUT parameters crashing each other when used in the same connection ("Philippe Lang" <philippe.lang@attiksystem.ch>) |
| Список | pgsql-general |
On Mon, Sep 04, 2006 at 06:16:49PM +0200, Philippe Lang wrote:
> > I have deleted the subroutines now, but problem remains. Does
> > that mean the variables created inside a plperl function are
> > alive for the duration of the database connection?
>
> It seems to be the case: if I rename all the variables in foo2 function, I do not have anymore problems.
>
> Is there a way to "flush" all the variables explicitely?
It seems to me you should be using lexical block-scoped variables, along the
lines of:
$$
do {
my @i = ('a','b'); # etc.
}
$$
Of course, doing the above doesn't give you the benefits of using
'strict', which enforces declaration (and hence encourages local
scoping) of variables. The following article may cast some light on
using strict (and indeed, plperl in general) with postgres:
http://www.oreillynet.com/pub/a/databases/2006/05/25/the-future-of-perl-in-postgresql.html
Best,
Randall
--
Randall Lucas Tercent, Inc. DF93EAD1
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера