Re: Fixed length datatypes. WAS [GENERAL] UUID's as

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, mark(at)mark(dot)mielke(dot)cc, Thomas Hallgren <thomas(at)tada(dot)se>, Josh Berkus <josh(at)agliodbs(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, "A(dot)M(dot)" <agentm(at)themactionfaction(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Date: 2006-07-01 14:37:59
Message-ID: 23967.1151764679@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> It would also be possible to provide two functions called hex_raw_in()
> and hex_raw_out() that people could use like so:

> CREATE TYPE uuid (
> input = hex_raw_in,
> output = hex_raw_out,
> INTERNALLENGTH = 16
> );

> Where these input/output functions would work for any given length, so
> the 16 could be replaced by any number, or even -1 to make a variable
> length type...

I believe you could make an input function that would support that,
though it would have to do a catalog lookup to find out the desired
type length. The output function, however, would be quite a trick.
It's not going to receive anything except the Datum itself.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-07-01 14:48:09 Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Previous Message Martijn van Oosterhout 2006-07-01 14:26:33 Re: Fixed length datatypes. WAS [GENERAL] UUID's as

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-07-01 14:48:09 Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Previous Message Martijn van Oosterhout 2006-07-01 14:26:33 Re: Fixed length datatypes. WAS [GENERAL] UUID's as