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

From: mark(at)mark(dot)mielke(dot)cc
To: Thomas Hallgren <thomas(at)tada(dot)se>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "Jim C(dot) Nasby" <jnasby(at)pervasive(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>, Martijn van Oosterhout <kleptog(at)svana(dot)org>
Subject: Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Date: 2006-06-30 08:04:19
Message-ID: 20060630080419.GA22763@mark.mielke.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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(at)mielke(dot)cc / markm(at)ncf(dot)ca / markm(at)nortel(dot)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 bind them...

http://mark.mielke.cc/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-06-30 08:38:49 Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Previous Message Thomas Hallgren 2006-06-30 06:53:28 Re: Fixed length datatypes. WAS [GENERAL] UUID's as

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-06-30 08:38:49 Re: Fixed length datatypes. WAS [GENERAL] UUID's as
Previous Message Thomas Hallgren 2006-06-30 06:53:28 Re: Fixed length datatypes. WAS [GENERAL] UUID's as