Re: plperl vs. bytea

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 11:18:25
Message-ID: 463F0B01.2050506@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout schrieb:
...
> 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.
>
Yes exactly. One way could be to pass the type binary and provide
a hull class for the PL/languages which then call the input/output
routines on the string boundaries of the type unless overridden by
user implementation. So default handling could be done in string
representation of the type whatever that is and for a defined set
of types every pl/language could implement special treatment like
mapping to natural types.

This handling can be done independently for every pl implementation
since it would for the most types just move the current type treatment
just a bit closer to the user code instead of doing all of it
in the call handler.

2nd problem is language interface for outside of the database scripting.
Efficient and lossless type handling there would improve some
situations - maybe a similar approach could be taken here.

Regards
Tino

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2007-05-07 12:36:55 Re: Managing the community information stream
Previous Message Martijn van Oosterhout 2007-05-07 10:20:09 Re: plperl vs. bytea