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.

Attachment: signature.asc
Description: Digital signature

Reply via email to