Re: PL/Perl embedding string common elements

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PL/Perl embedding string common elements
Дата
Msg-id 18624.1124587129@sss.pgh.pa.us
обсуждение исходный текст
Ответ на PL/Perl embedding string common elements  (Michael Fuhr <mike@fuhr.org>)
Ответы Re: PL/Perl embedding string common elements  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-patches
Michael Fuhr <mike@fuhr.org> writes:
> The attached patch moves the common elements of loose_embedding[]
> and strict_embedding[] to a macro so they can be maintained in
> one place.  As Tom Lane noticed, ::_plperl_to_pg_array was missing
> from strict_embedding[], which appears to be a bug.

Actually, it strikes me that this is working around a problem that
we shouldn't have in the first place: there should not be two different
embedding strings.  I hadn't noticed the use_strict GUC before, but
now that I see it, I think it's implemented in a completely awful
way.  Because the embedding string is only executed once per backend,
it's effectively impossible to change use_strict on the fly.  I think
we should be looking for another implementation of that feature, rather
than just cleaning up the minor breakage.  One would expect changes
in the variable to at least affect future function compilations in
the current backend, if not indeed recompiling already-compiled ones.

I'm not much of a Perl guru, but could we make this happen by having
four functions instead of two?  (mksafefunc, mksafestrictfunc, etc)
I'm not too clear on what the scope of effects of 'use strict' is.

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: prevent encoding conversion recursive error
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: PL/Perl embedding string common elements