Unix Technical Forum

Re: [PATCHES] WIP 2 interpreters for plperl

This is a discussion on Re: [PATCHES] WIP 2 interpreters for plperl within the pgsql Hackers forums, part of the PostgreSQL category; --> [moving to -hackers] I wrote: > >> >> I have made some progress with what I think is needed ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 05:35 AM
Andrew Dunstan
 
Posts: n/a
Default Re: [PATCHES] WIP 2 interpreters for plperl


[moving to -hackers]

I wrote:
>
>>
>> I have made some progress with what I think is needed to have two
>> interpreters for plperl. This is a lot harder than the pltcl case for
>> two reasons: 1. there are no restrictions on having 2 tcl
>> interpreters, and 2. tcl does not need to save and restore context as
>> we have to do with perl. I think I have a conceptual siolution to
>> these two problems, but what I have is currently segfaulting somewhat
>> myteriously. Tracing a dynamically loaded library in a postgres
>> backend with a debugger is less than fun, too. I am attaching what I
>> currently have, liberally sprinkled with elog(NOTICE) calls as trace
>> writes.
>>
>>

>
> With a little more perseverance I found the problem. The attached
> patch passes regression. But it now needs plenty of eyeballs and testing.
>
>


Well, if anyone cast eyeballs over it they kept it secret from me :-(


However, I have now tested the patch with the little script shown below
and it seems to do the Right Thing (tm) in switching context and
restoring it. So I think it can be applied to HEAD, along with an
addition to the docs and a release note.

Since this is a behaviour modification, do we want to apply it to the
back branches? Doing so would certainly be possible, although it would
be non-trivial.

cheers

andrew


------------

drop function if exists f1(int);
drop function if exists f2(int);


create function f1(int) returns void language plperl as
$$

my $arg = shift;
elog NOTICE,"in plperl func f1($arg)";
return if ($arg > 5);
$arg++;
spi_exec_query("select f2($arg)");

$$;

create function f2(int) returns void language plperlu as
$$

my $arg = shift;
elog NOTICE,"in plperlu func f2($arg)";
return if ($arg > 5);
$arg++;
spi_exec_query("select f1($arg)");

$$;


select f1(0);
select f2(0);




---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 05:36 AM
Andrew Dunstan
 
Posts: n/a
Default Re: [PATCHES] WIP 2 interpreters for plperl

I wrote:
>
> [moving to -hackers]
>
> I wrote:
>>
>>>
>>> I have made some progress with what I think is needed to have two
>>> interpreters for plperl. This is a lot harder than the pltcl case
>>> for two reasons: 1. there are no restrictions on having 2 tcl
>>> interpreters, and 2. tcl does not need to save and restore context
>>> as we have to do with perl. I think I have a conceptual siolution to
>>> these two problems, but what I have is currently segfaulting
>>> somewhat myteriously. Tracing a dynamically loaded library in a
>>> postgres backend with a debugger is less than fun, too. I am
>>> attaching what I currently have, liberally sprinkled with
>>> elog(NOTICE) calls as trace writes.
>>>
>>>

>>
>> With a little more perseverance I found the problem. The attached
>> patch passes regression. But it now needs plenty of eyeballs and
>> testing.
>>
>>

>
> Well, if anyone cast eyeballs over it they kept it secret from me :-(
>
>
> However, I have now tested the patch with the little script shown
> below and it seems to do the Right Thing (tm) in switching context and
> restoring it. So I think it can be applied to HEAD, along with an
> addition to the docs and a release note.
>
> Since this is a behaviour modification, do we want to apply it to the
> back branches? Doing so would certainly be possible, although it would
> be non-trivial.
>


I have committed this to HEAD at any rate, so that we can get some
buildfarm testing going.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:19 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com