Re: plperl vs. bytea

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Theo Schlossnagle <jesus(at)omniti(dot)com>
Subject: Re: plperl vs. bytea
Date: 2007-05-07 10:20:09
Message-ID: 20070507102009.GA9410@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, May 06, 2007 at 08:48:28PM -0400, Tom Lane wrote:
> What we've basically got here is a complaint that the default
> textual-representation-based method for transmitting PL function
> parameters and results is awkward and inefficient for bytea.
> So the first question is whether this is really localized to only
> bytea, and if not which other types have got similar issues.
> (Even if you make the case that no other scalar types need help,
> what of bytea[] and composite types containing bytea or bytea[]?)

I must say I was indeed surprised by the idea that bytea is passed by
text, since Perl handles embedded nulls in strings without any problem
at all. Does this mean integers are passed as text also? I would have
expected an array argument to be passed as an array, but now I'm not so
sure.

So I'm with Tom on this one: there needs to be a serious discussion
about how types are passed to Perl and the costs associated with it.

I do have one problem though: for bytea/integers/floats Perl has
appropriate internel representations. But what about other user-defined
types? Say the user-defined UUID type, it should probably also passed
by a byte string, yet how could Perl know that. That would imply that
user-defined types need to be able to specify how they are passed to
PLs, to *any* PL.

So fixing it for bytea is one thing, but there's a bigger issue here
that needs discussion.

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tino Wildenhain 2007-05-07 11:18:25 Re: plperl vs. bytea
Previous Message Zdenek Kotala 2007-05-07 06:28:40 Re: Integer datetimes