Re: US Telephone Number Type - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: US Telephone Number Type
Date
Msg-id 20060711052749.GA32706@surnet.cl
Whole thread Raw
In response to Re: US Telephone Number Type  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: US Telephone Number Type  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Tom Lane wrote:
> "Karen Hill" <karen_hill22@yahoo.com> writes:
> > I did a quick google and someone mentioned that input and output
> > functions need to be written in C.  Is that still the case?
>
> Yeah, pretty much.  The main problem is that such functions need to deal
> with whatever physical on-disk format you've chosen for the datatype,
> and most of our PLs don't offer bit-level memory access.

Is bit-level memory access the actual problem?  I would think that at
least PL/Perl can offer that pretty easily using pack() or something
like that.  Not that I've actually tried using it.

But I think the main problem may be getting our calling conventions
right.  I mean, how would you do a PG_GETARG_BOOL() or stuff like that?
Maybe if we offered PG_GETARG_DATUM and PG_RETURN_DATUM equivalents in
PL/Perl we could offer I/O functions there.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: A function which returns all rolname from pg_roles.
Next
From: "Christian Rengstl"
Date:
Subject: Re: Problem with COPY