Re: plperl/plperlu interaction

Lists: pgsql-hackers
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: plperl/plperlu interaction
Date: 2006-10-26 17:37:01
Message-ID: 4540F23D.9090306@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Recently while doing a little research on how we could do perl module
preloading nicely, I constructed the following:

create function loadmods() returns void language plperlu as $$
use LWP::UserAgent;
$$;
select loadmods();
create function loadurl() returns text language plperl as $$
my $ua = LWP::UserAgent->new;
my $response = $ua->get('http://search.cpan.org/');
return $response->as_string;
$$;
select loadurl();

This works because plperl and plperlu share a common interpreter. I have
thought some about whether or not it is a security risk, and decided it
probably isn't, because only a superuser could construct the plperlu
function to load the external module - if an ordinary user tried it in
trusted plperl code there would be a perl error generated. It remains
true that a plperl function cannot on its own get access to an external
module, and to that extent we haven't broken the trust criteria. The
only way I know of in which we could actually prevent this effect would
be to run separate interpreters for plperl and plperlu. That wouldn't be
a great tragedy on its own, as perl interpreters aren't hugely heavy
objects, but we would probably break some legacy code, and it would take
a not insignificant coding effort. So we'd want to be very sure we
wanted to do that - personally I can live with this easily enough - the
superuser just has to be careful what they do. In cases of paranoia they
could use Symbol::delete_package() when they were done with the module,
although constantly loading and unloading a module won't perform very
nicely.

Anyway, it is probably not expected by many users that loading a module
in plperlu makes it available to plperl - I was slightly surprised
myself to see it work and I am probably more aware than most of perl and
plperl subtleties. I think therefore that at least this should be
documented.

thoughts?

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 18:26:26
Message-ID: 23205.1161887186@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Anyway, it is probably not expected by many users that loading a module
> in plperlu makes it available to plperl - I was slightly surprised
> myself to see it work and I am probably more aware than most of perl and
> plperl subtleties.

I think that is a bug and needs to be fixed. We have the precedent of
pltcl, which uses separate interpreters for pltcl and pltclu for exactly
this reason.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 18:57:09
Message-ID: 45410505.8080502@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> Anyway, it is probably not expected by many users that loading a module
>> in plperlu makes it available to plperl - I was slightly surprised
>> myself to see it work and I am probably more aware than most of perl and
>> plperl subtleties.
>>
>
> I think that is a bug and needs to be fixed. We have the precedent of
> pltcl, which uses separate interpreters for pltcl and pltclu for exactly
> this reason.
>
>

Fair enough.

I am not sure what our release timetable is - and presumably this should
also be backpatched if we regard it as a bug. I won't be able to do much
on this front for the next 2 weeks at least.

cheers

andrew


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 19:15:00
Message-ID: 45410934.8070703@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan wrote:
> Tom Lane wrote:
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>
>>> Anyway, it is probably not expected by many users that loading a
>>> module in plperlu makes it available to plperl - I was slightly
>>> surprised myself to see it work and I am probably more aware than
>>> most of perl and plperl subtleties.
>>>
>>
>> I think that is a bug and needs to be fixed. We have the precedent of
>> pltcl, which uses separate interpreters for pltcl and pltclu for exactly
>> this reason.
>>
>>
>
> Fair enough.
>
> I am not sure what our release timetable is - and presumably this
> should also be backpatched if we regard it as a bug. I won't be able
> to do much on this front for the next 2 weeks at least.
>

There is one other wrinkle, that has just come to my attention courtesy
of Andrew(at)SuperNews(dot) This is what the perlembed man page says:

Now suppose we have more than one interpreter instance running at the
same time. This is feasible, but only if you used the Configure
option
"-Dusemultiplicity" or the options "-Dusethreads -Duseithreads" when
building perl.

Now my local perl (FC5/ia64) has usemultiplicity defined. I am not sure
how common this is.

Perhaps people who use other platforms could look for these flags in the
output of
perl -e 'use Config qw(myconfig config_sh config_vars config_re);
print config_sh();'

cheers

andrew


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 19:23:22
Message-ID: 20061026192322.GA14773@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Oct 26, 2006 at 03:15:00PM -0400, Andrew Dunstan wrote:
> Perhaps people who use other platforms could look for these flags in the
> output of
> perl -e 'use Config qw(myconfig config_sh config_vars config_re);
> print config_sh();'

My Debian Sarge (i386) has:

useithreads='define'
usethreads='define'
usemultiplicity='define'

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 19:26:08
Message-ID: 24177.1161890768@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Now suppose we have more than one interpreter instance running at the
> same time. This is feasible, but only if you used the Configure
> option
> "-Dusemultiplicity" or the options "-Dusethreads -Duseithreads" when
> building perl.

> Now my local perl (FC5/ia64) has usemultiplicity defined. I am not sure
> how common this is.

Ouch. It's certainly not the default configuration :-(

regards, tom lane


From: Jeff Trout <threshar(at)torgo(dot)978(dot)org>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 19:35:11
Message-ID: 783B59D0-5704-4B80-B548-A5A1178F0E15@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Oct 26, 2006, at 3:23 PM, Martijn van Oosterhout wrote:

> On Thu, Oct 26, 2006 at 03:15:00PM -0400, Andrew Dunstan wrote:
>> Perhaps people who use other platforms could look for these flags
>> in the
>> output of
>> perl -e 'use Config qw(myconfig config_sh config_vars config_re);
>> print config_sh();'
>

OSX 10.4.8:

usemultiplicity='define'
usethreads='define'
useithreads='define'

--
Jeff Trout <jeff(at)jefftrout(dot)com>
http://www.dellsmartexitin.com/
http://www.stuarthamm.net/


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Jeff Trout <threshar(at)real(dot)jefftrout(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 19:39:17
Message-ID: 20061026193917.GC31183@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Jeff Trout wrote:
>
> On Oct 26, 2006, at 3:23 PM, Martijn van Oosterhout wrote:
>
> >On Thu, Oct 26, 2006 at 03:15:00PM -0400, Andrew Dunstan wrote:
> >>Perhaps people who use other platforms could look for these flags
> >>in the
> >>output of
> >> perl -e 'use Config qw(myconfig config_sh config_vars config_re);
> >>print config_sh();'
> >
>
> OSX 10.4.8:
>
> usemultiplicity='define'
> usethreads='define'
> useithreads='define'

Same here on Debian unstable (stock Perl packages).

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Jeff Trout <threshar(at)torgo(dot)978(dot)org>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 19:39:35
Message-ID: 20061026193935.GH26892@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Oct 26, 2006 at 03:35:11PM -0400, Jeff Trout wrote:
>
> On Oct 26, 2006, at 3:23 PM, Martijn van Oosterhout wrote:
>
> >On Thu, Oct 26, 2006 at 03:15:00PM -0400, Andrew Dunstan wrote:
> >>Perhaps people who use other platforms could look for these flags
> >>in the
> >>output of
> >> perl -e 'use Config qw(myconfig config_sh config_vars config_re);
> >>print config_sh();'
> >
>
> OSX 10.4.8:
>
> usemultiplicity='define'
> usethreads='define'
> useithreads='define'

All 3 are undef on FreeBSD 6.1.
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


From: Jeremy Drake <pgsql(at)jdrake(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 19:47:42
Message-ID: Pine.BSO.4.64.0610261244280.27423@resin.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, 26 Oct 2006, Alvaro Herrera wrote:

> Jeff Trout wrote:
> >
> > On Oct 26, 2006, at 3:23 PM, Martijn van Oosterhout wrote:
> >
> > >On Thu, Oct 26, 2006 at 03:15:00PM -0400, Andrew Dunstan wrote:
> > >>Perhaps people who use other platforms could look for these flags
> > >>in the
> > >>output of
> > >> perl -e 'use Config qw(myconfig config_sh config_vars config_re);
> > >>print config_sh();'
> > >
> >
> > OSX 10.4.8:
> >
> > usemultiplicity='define'
> > usethreads='define'
> > useithreads='define'
>
> Same here on Debian unstable (stock Perl packages).

On my current Gentoo box:
useithreads='undef'
usemultiplicity='undef'
usethreads='undef'

My USE flags have ithreads disabled, since the description of the feature
is "Enable Perl threads, has some compatibility problems"

--
Whether you can hear it or not
The Universe is laughing behind your back
-- National Lampoon, "Deteriorata"


From: Alexey Klyukin <alexk(at)vollmond(dot)org(dot)ua>
To: Jeremy Drake <pgsql(at)jdrake(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 19:58:39
Message-ID: 4541136F.8050504@vollmond.org.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Jeremy Drake wrote:
> On Thu, 26 Oct 2006, Alvaro Herrera wrote:
>
>
>> Jeff Trout wrote:
>>
>>> On Oct 26, 2006, at 3:23 PM, Martijn van Oosterhout wrote:
>>>
>>>
>>>> On Thu, Oct 26, 2006 at 03:15:00PM -0400, Andrew Dunstan wrote:
>>>>
>>>>> Perhaps people who use other platforms could look for these flags
>>>>> in the
>>>>> output of
>>>>> perl -e 'use Config qw(myconfig config_sh config_vars config_re);
>>>>> print config_sh();'
>>>>>
>>> OSX 10.4.8:
>>>
>>> usemultiplicity='define'
>>> usethreads='define'
>>> useithreads='define'
>>>
>> Same here on Debian unstable (stock Perl packages).
>>
>
> On my current Gentoo box:
> useithreads='undef'
> usemultiplicity='undef'
> usethreads='undef'
>
> My USE flags have ithreads disabled, since the description of the feature
> is "Enable Perl threads, has some compatibility problems"
>
>
>
On my Ubuntu 'Dapper' system:
useithreads='define'
usemultiplicity='define'
usethreads='define'

And I'm getting 'undef' for each of these flags on both Gentoo 2006.1
and Gentoo 1.4 systems using the default perl installation.


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 19:58:40
Message-ID: 45411370.1040102@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> Now suppose we have more than one interpreter instance running at the
>> same time. This is feasible, but only if you used the Configure
>> option
>> "-Dusemultiplicity" or the options "-Dusethreads -Duseithreads" when
>> building perl.
>>
>
>
>> Now my local perl (FC5/ia64) has usemultiplicity defined. I am not sure
>> how common this is.
>>
>
> Ouch. It's certainly not the default configuration :-(
>
>
>

Well, so far many Linux platforms look OK, but FBSD does not.

This could be ugly ;-(

cheers

andrew


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 20:09:56
Message-ID: 45411614.8080500@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan wrote:
> Tom Lane wrote:
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>
>>> Now suppose we have more than one interpreter instance running
>>> at the
>>> same time. This is feasible, but only if you used the
>>> Configure option
>>> "-Dusemultiplicity" or the options "-Dusethreads
>>> -Duseithreads" when
>>> building perl.
>>>
>>
>>
>>> Now my local perl (FC5/ia64) has usemultiplicity defined. I am not
>>> sure how common this is.
>>>
>>
>> Ouch. It's certainly not the default configuration :-(
>>
>>
>>
>
> Well, so far many Linux platforms look OK, but FBSD does not.

OpenBSD (which has perl in base) also has those 3 NOT defined ...

>
> This could be ugly ;-(

yeah ...

Stefan


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 20:20:32
Message-ID: 200610261320.33307.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew,

> My Debian Sarge (i386) has:
>
> useithreads='define'
> usethreads='define'
> usemultiplicity='define'

I get the same on Ubuntu and SuSE 9.3, so I think those are pervasive
settings for Linux.

Solaris 10update1:

useithreads='undef'
usethreads='undef'
usemultiplicity='undef'

--
--Josh

Josh Berkus
PostgreSQL @ Sun
San Francisco


From: "Andrej Ricnik-Bay" <andrej(dot)groups(at)gmail(dot)com>
To: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
Cc: "Jeff Trout" <threshar(at)torgo(dot)978(dot)org>, "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 20:42:40
Message-ID: b35603930610261342u265d225bn82acdbe4d6b0fe35@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 10/27/06, Jim C. Nasby <jim(at)nasby(dot)net> wrote:
Undef in Slackware 10.2
Def in Ubuntu 6.06
Undef in Mandriva 2006
Undef in Solaris 10 06
Def in SLES 9.2
Perl 5.8 in SLES 8.1 throws a fit:
"Array found where operator expected at
/usr/lib/perl5/5.8.0/warnings.pm line 294, at end of line
(Missing operator before ?)
Undefined subroutine &main::config_sh called at -e line 2."

Perl 5.004 in solaris 6&7 does't doesn't do config_re,
neither does the perl 5.6 in Solaris 9


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Andrej Ricnik-Bay <andrej(dot)groups(at)gmail(dot)com>
Cc: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Jeff Trout <threshar(at)real(dot)jefftrout(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 20:58:21
Message-ID: 4541216D.1080202@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrej Ricnik-Bay wrote:
> On 10/27/06, Jim C. Nasby <jim(at)nasby(dot)net> wrote:
> Undef in Slackware 10.2
> Def in Ubuntu 6.06
> Undef in Mandriva 2006
> Undef in Solaris 10 06
> Def in SLES 9.2
> Perl 5.8 in SLES 8.1 throws a fit:
> "Array found where operator expected at
> /usr/lib/perl5/5.8.0/warnings.pm line 294, at end of line
> (Missing operator before ?)
> Undefined subroutine &main::config_sh called at -e line 2."
>
>
> Perl 5.004 in solaris 6&7 does't doesn't do config_re,
> neither does the perl 5.6 in Solaris 9
>

You can also examine the output from perl -V

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Andrej Ricnik-Bay <andrej(dot)groups(at)gmail(dot)com>, "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Jeff Trout <threshar(at)real(dot)jefftrout(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 21:24:37
Message-ID: 25670.1161897877@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> You can also examine the output from perl -V

I think we've already established that we won't be able to ignore the
case of not having support for multiple perl interpreters :-(

So it seems we have these choices:

1. Do nothing (document it as a feature not a bug)

2. Support separate interpreters if possible, do nothing if not
(still needs documentation)

3. Support separate interpreters if possible, refuse to run both plperl
and plperlu functions in the same backend if not.

Any other compromises possible?

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrej Ricnik-Bay <andrej(dot)groups(at)gmail(dot)com>, "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Jeff Trout <threshar(at)real(dot)jefftrout(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 21:45:09
Message-ID: 45412C65.1040504@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> You can also examine the output from perl -V
>>
>
> I think we've already established that we won't be able to ignore the
> case of not having support for multiple perl interpreters :-(
>
> So it seems we have these choices:
>
> 1. Do nothing (document it as a feature not a bug)
>
> 2. Support separate interpreters if possible, do nothing if not
> (still needs documentation)
>
> 3. Support separate interpreters if possible, refuse to run both plperl
> and plperlu functions in the same backend if not.
>
> Any other compromises possible?
>
>

How would we decide which wins in the third case? "first in" seems
rather arbitrary. If we went that way I'd probably plump for just
plperlu to be allowed. The the worst effect would be that the functions
would have to be created by the superuser. It would be a great pity, of
course - this threatens to do horrible things to portability ;-(

I guess another possibility would be to allow 3 to be overridden by a
switch to become 2.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Andrej Ricnik-Bay <andrej(dot)groups(at)gmail(dot)com>, "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Jeff Trout <threshar(at)real(dot)jefftrout(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl/plperlu interaction
Date: 2006-10-26 21:59:14
Message-ID: 26136.1161899954@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Tom Lane wrote:
>> 3. Support separate interpreters if possible, refuse to run both plperl
>> and plperlu functions in the same backend if not.

> How would we decide which wins in the third case? "first in" seems
> rather arbitrary. If we went that way I'd probably plump for just
> plperlu to be allowed.

"First used in a given backend" was exactly what I had in mind.
Certainly it wouldn't be perfect, but your proposal seems to be
"disable plperl altogether if no separate-interpreter support",
which seems overly harsh. Especially for someone who doesn't
even want to install plperlu.

regards, tom lane


From: Mark Dilger <pgsql(at)markdilger(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: plperl/plperlu interaction
Date: 2006-11-09 22:41:35
Message-ID: 4553AE9F.9090501@markdilger.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> Anyway, it is probably not expected by many users that loading a module
>> in plperlu makes it available to plperl - I was slightly surprised
>> myself to see it work and I am probably more aware than most of perl and
>> plperl subtleties.
>
> I think that is a bug and needs to be fixed. We have the precedent of
> pltcl, which uses separate interpreters for pltcl and pltclu for exactly
> this reason.

If this is fixed, what becomes the mechanism for an administrator to make a perl
module available to plperl functions? I didn't see any other way to do this
documented. Thanks,

mark


From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: "Mark Dilger" <pgsql(at)markdilger(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: plperl/plperlu interaction
Date: 2006-11-10 01:48:30
Message-ID: 1890.24.211.165.134.1163123310.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Mark Dilger wrote:
> Tom Lane wrote:
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>> Anyway, it is probably not expected by many users that loading a
module
>>> in plperlu makes it available to plperl - I was slightly surprised
myself to see it work and I am probably more aware than most of perl
and
>>> plperl subtleties.
>> I think that is a bug and needs to be fixed. We have the precedent of
pltcl, which uses separate interpreters for pltcl and pltclu for
exactly
>> this reason.
>
> If this is fixed, what becomes the mechanism for an administrator to
make
> a perl
> module available to plperl functions? I didn't see any other way to do
this
> documented. Thanks,
>

This isn't documented either :-)

I discovered this when I was working on a way of doing this nicely and
safely. I hope to have that for 8.3.

cheers

andrew