Re: New data type: uniqueidentifier - Mailing list pgsql-hackers

From Alex Pilosov
Subject Re: New data type: uniqueidentifier
Date
Msg-id Pine.BSO.4.10.10106261758560.21119-100000@spider.pilosoft.com
Whole thread Raw
In response to New data type: uniqueidentifier  ("Dmitry G. Mastrukov" <dmitry@taurussoft.org>)
List 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.



pgsql-hackers by date:

Previous
From: Alex Pilosov
Date:
Subject: functions returning records
Next
From: Bruce Momjian
Date:
Subject: Re: Re: Encrypting pg_shadow passwords