Re: another plperl bug

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Richard Poole <rp(at)guests(dot)deus(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: another plperl bug
Date: 2004-11-23 19:47:25
Message-ID: 41A393CD.7080403@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kenneth Marshall 2004-11-23 20:15:02 Solaris 8 regression test failure with 8.0.0beta5
Previous Message Jim Seymour 2004-11-23 19:37:02 Re: OpenBSD/Sparc status

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2004-11-23 20:54:53 Re: htmlhelp generation
Previous Message Tom Lane 2004-11-23 19:12:46 Re: another plperl bug