Re: Fixed length datatypes. WAS [GENERAL] UUID's as - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Date
Msg-id 20060701142633.GF24775@svana.org
Whole thread Raw
In response to Re: Fixed length datatypes. WAS [GENERAL] UUID's as  ("Jim C. Nasby" <jnasby@pervasive.com>)
Responses Re: Fixed length datatypes. WAS [GENERAL] UUID's as
List pgsql-hackers
On Fri, Jun 30, 2006 at 12:45:13PM -0500, Jim C. Nasby wrote:
> > If people agree to a generic 16-byte type, or a hex type with defined
> > fixed length with a set of standard functions and index operators that
> > it should work for, but nobody more qualified wants to make the patch
> > - I'll step up.
>
> I think it'd be extremely useful to have a means of defining
> fixed-length hex types, such as UUIDs and hashes (ie: SHA1). I usually
> only see people trying to do the same thing for CHAR in poorly-designed
> systems, but I suspect anyone dealing with legacy stuff might welcome
> that ability as well.

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...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Interval aggregate regression failure (expected seems
Next
From: Tom Lane
Date:
Subject: Re: Fixed length datatypes. WAS [GENERAL] UUID's as