Re: another plperl bug - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: another plperl bug
Date
Msg-id 41A393CD.7080403@dunslane.net
Whole thread Raw
In response to Re: another plperl bug  (Richard Poole <rp@guests.deus.net>)
List pgsql-hackers

Richard Poole wrote:

>
>
>Indeed. It would be Perlish to have some magic so that when you called
>one PL/Perl function from another you could return an array ref from
>the inner one and have it Do What You Mean in the outer one, too.
>
>
>
>  
>

There is no way to have one plperl function call another directly - they 
are anonymous and a reference to them is not stored anywhere accessible 
inside the perl interpreter. The only place the reference is stored is 
in a table on the C side of the plperl glue code.

This is an architectural limitation that is not easily overcome.

Back to the original suggestion - I would like to have a lot more magic 
that maps between perl hashrefs and postgres composites, and between 
perl arrayrefs and postgres arrays. A plperl programmer should ideally 
never have to construct or deconstruct the text representation of an 
array or a composite. That will have to be looked at after this release 
- we only just hit the feature freeze cutoff with what we have now, 
which is why a few warts are coming to light.

cheers

andrew


pgsql-hackers by date:

Previous
From: jseymour@linxnet.com (Jim Seymour)
Date:
Subject: Re: OpenBSD/Sparc status
Next
From: Darcy Buskermolen
Date:
Subject: Re: OpenBSD/Sparc status