Re: UUID/GUID discussion leading to request for hexstring bytea? (was: Re: TODO: GUID datatype) - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: UUID/GUID discussion leading to request for hexstring bytea? (was: Re: TODO: GUID datatype)
Date
Msg-id 20060907093505.GB10093@svana.org
Whole thread Raw
In response to UUID/GUID discussion leading to request for hexstring bytea? (was: Re: TODO: GUID datatype)  (mark@mark.mielke.cc)
Responses Looking at Postgres 8.2  ("Strong, David" <david.strong@unisys.com>)
List pgsql-hackers
On Wed, Sep 06, 2006 at 05:05:47PM -0400, mark@mark.mielke.cc wrote:
>     2) Create semi-generic types with common bitlengths. Associated
>        functions work on these semi-generic types. No overhead.
>            - hexstring128, hexstring160, ...
>
>     3) Create a new bytea type that has ascii input and output formats,
>        probably based around hexstrings. Overhead of 4 bytes.

I think 3) is worthwhile for core, it would have many uses. But you
don't actually need to have a new type for that, just new I/O
functions.

As for 2) I think would be acceptable for contrib to contain some code
that demonstrates how to make fixed length types. It would be fairly
straightforward to make a script where you give it a type name and a
length and it'll spit out the code for that type.

I don't think UUID specific stuff needs to be in core, though you could
make an argument that the hex input/output functions should ignore
dashes, to make it straightforward to store UUIDs directly in there.

Hope this helps,
--
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: Csaba Nagy
Date:
Subject: Re: FE/BE protocol vs. parameterized queries
Next
From: Gregory Stark
Date:
Subject: Re: Win32 hard crash problem