Skip site navigation (1) Skip section navigation (2)

Re: Re: New data type: uniqueidentifier

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: Thomas Swan <tswan(at)olemiss(dot)edu>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, "Dmitry G(dot) Mastrukov" <dmitry(at)taurussoft(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: New data type: uniqueidentifier
Date: 2001-07-02 18:39:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Mon, 2 Jul 2001, Thomas Swan wrote:

> Peter Eisentraut wrote:
> >Dmitry G. Mastrukov writes:
> >
> >>I've developed new data type for PostgreSQL - unique identifier - 128-bit
> >>value claims to be unique across Universe. It depends on libuuid from
> >>e2fsprogs by Theodore Ts'o.
> >>
> >
> >ISTM that this should be a function, not a data type.
> >
> I'd second the function idea: function uuid( ) returns an int8 value; 
> don't create a bazillion datatypes.  Besides, 128 bit numbers are 7 byte 
> integers.   PostgreSQL has an int8 (8 byte integer) datatype.  While I 
> like the UUID function idea, I'd recommend a better solution to creating 
> an "unique" identifier.  Why not create a serial8 datatype: int8 with an 
> int8 sequence = 256bit "unique" number.  {Yes, I know I'm violating my 
> first sentence.}  Then, you'd have the same thing (or better) AND your 
> not relying on randomness.  

I don't think you know what UUID is. It is NOT just a unique randon
number. There are specific rules for construction of such number, specific
rules for comparison of numbers (no, its not bit-by-bit), thus a datatype
is most appropriate answer. 


In response to


pgsql-hackers by date

Next:From: Nathan MyersDate: 2001-07-02 18:58:15
Subject: Re: shared library strangeness?
Previous:From: Peter EisentrautDate: 2001-07-02 17:42:08
Subject: Re: tab

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group