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

From mark@mark.mielke.cc
Subject Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Date
Msg-id 20060630080419.GA22763@mark.mielke.cc
Whole thread Raw
In response to Re: Fixed length datatypes. WAS [GENERAL] UUID's as  (Thomas Hallgren <thomas@tada.se>)
Responses Re: Fixed length datatypes. WAS [GENERAL] UUID's as  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
On Fri, Jun 30, 2006 at 08:53:28AM +0200, Thomas Hallgren wrote:
> Josh Berkus wrote:
> >> I agree about splitting the utilities, except that I think the database
> >> should be able to generate UUIDs somehow.
> > There is a GUID add-in, and someone is working on a 2nd one.  UUIDs 
> > are not part of the SQL standard, and we've only seen sporadic demand 
> > for them (and different types each time) so I can't imagine one making 
> > it further than contrib real soon.
> >
> > Also, one could argue that UUIDs are a foot gun, so they're not 
> > exactly the type of thing we want to advocate in advance of demand.

Josh: Although PostgreSQL is easy to extend - it is still beyond many
people to put in the time required to learn how. The demand exists.
It's the supply that doesn't. People work around the problem.
Perhaps they are using one of the sequence number 'tricks' such as
having each site be allocated a range, or modulus. I was willing to
learn how to implement a UUID type, and not willing to use one of
these sequence number hacks.

If you want to call UUID a foot gun - then please call sequence
numbers hacks a foot gun as well, to be fair, and then we can start
to talk about how a theoretically perfect system should work.

If UUID existed in core, people would use it. It would be used, and it
would be abused - like most other PostgreSQL features. There would be
nothing unique about this. And what's the real danger anyways? People
who should be using 4 byte or 8 byte sequences, find that they lose
a little performance, and that their databases are larger than they
expected? UUID is designed not to collide. So what is the real danger
you are speaking about? How bad can they shoot themselves?

> Martijn van Oosterhout wrote:
> > It seems to me that maybe the backend should include a 16-byte fixed
> > length object (after all, we've got 1, 2, 4 and 8 bytes already) and
> > then people can use that to build whatever they like, using domains,
> > for example...
> So how about the split? I.e. just add a 16 byte data type and forget all 
> about UUID's for now.

Martijn: Were you thinking that it would look like a really big integer,
displayed by default as a decimal string in the client?

This makes sense to me.

If it was a full data type - could it be passed around in memory by
value, and not as a pointer? Or is 16 bytes too big to pass around by
value?

Cheers,
mark

-- 
mark@mielke.cc / markm@ncf.ca / markm@nortel.com     __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada
 One ring to rule them all, one ring to find them, one ring to bring them all                      and in the darkness
bindthem...
 
                          http://mark.mielke.cc/



pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Fixed length datatypes. WAS [GENERAL] UUID's as