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

Re: New data type: uniqueidentifier

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: "Dmitry G(dot) Mastrukov" <dmitry(at)taurussoft(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: New data type: uniqueidentifier
Date: 2001-06-26 22:02:46
Message-ID: Pine.BSO.4.10.10106261758560.21119-100000@spider.pilosoft.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, 26 Jun 2001, Dmitry G. Mastrukov wrote:

> myself some things.
> I've marked "=" operator with HASH clause (and planner has started to use
> hash jons). But as I understand the right way is to create special hash
> function (may be wrapper for hash_any(), isn't it?) and register it for hash
> as for btree method.

No. Currently, there's no way to specify a hash function for a given
operator, it always uses a builtin function that operates on memory
representation of a value.

There's no need (or possibility) to register a hash with btree method.

> So is it desirable to mark "=" as HASH for this type (seems internal 16 byte
> representation will be hash well) and if yes how can I create hash sort
> method for uniqueidentifier?
You can mark it hashable, since two identical uuid values would have
identical memory representation and thus the same hash value. 

I'd look at your code, but that is URL too slow, in 5 minutes downloaded
1000 bytes...

> regards,
> Dmitry
> 
> PS. If you decide to install uniqueidentifier look at the date of
> uuid/uuid.h somewhere in INCLUDE path. Sometimes it's necessary to manualy
> enter "make install" in lib/uuid directory of e2fsprogs.


In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-06-26 23:17:21
Subject: Re: Re: Encrypting pg_shadow passwords
Previous:From: Alex PilosovDate: 2001-06-26 21:11:47
Subject: functions returning records

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