Hash Support Function

Started by Soroosh Sardariover 12 years ago3 messagesgeneral
Jump to latest
#1Soroosh Sardari
soroosh.sardari@gmail.com

Dear all

I'm developing a new type, and want to have hash index on it.
I must write a hash function for the new type, according to the PG manual,
section 35.14.3.
However, there is no example for this function. Actually signature of the
hash support function
would be sufficient for me.

Any help appreciated, in advance

Regards,
Soroosh

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Soroosh Sardari (#1)
Re: Hash Support Function

Soroosh Sardari <soroosh.sardari@gmail.com> writes:

I'm developing a new type, and want to have hash index on it.
I must write a hash function for the new type, according to the PG manual,
section 35.14.3.
However, there is no example for this function. Actually signature of the
hash support function
would be sufficient for me.

hashfunc(yourtype) returns integer strict immutable

For examples see hashint4, hashfloat8, hashtext, and many others.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Marc Mamin
M.Mamin@intershop.de
In reply to: Soroosh Sardari (#1)
Re: Hash Support Function

________________________________

I'm developing a new type, and want to have hash index on it.
I must write a hash function for the new type, according to the PG manual, section 35.14.3.
However, there is no example for this function. Actually signature of the hash support function
would be sufficient for me.

Hello,
Have a look at pghashlib:
https://github.com/markokr/pghashlib

regards,

Marc Mamin