Re: PostgreSQL's hashing function? - Mailing list pgsql-general

From Kynn Jones
Subject Re: PostgreSQL's hashing function?
Date
Msg-id c2350ba40802230541x116714e6n61e2b01a97940dc1@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL's hashing function?  (Greg Stark <stark@enterprisedb.com>)
List pgsql-general


On Fri, Feb 22, 2008 at 8:12 PM, Greg Stark <stark@enterprisedb.com> wrote:

You could use hashtext() which is Postgres's internal hash function.

Awesome!
 
There's some possibility it could change in future versions of Postgres
though.

I can live with that, especially if all that changes is the implementation, and not its availability.  The use I have in mind is strictly internal, so the possibility that a given string may get a different hashkey if PostgreSQL gets upgraded is no problem at all.

Thanks for the pointer!  It's not in the docs, so I would have never found it on my own...  (It makes me wonder what other "hidden" PostgreSQL goodies are out there.  I know, I know, peeking behind the published API is evil...  I guess I'm a geek "in a state of sin", to use von Neumann's terms...)

kynn

pgsql-general by date:

Previous
From: "Kynn Jones"
Date:
Subject: Re: Queries w/ "computed" table names? (eval in Pg?)
Next
From: Jorge Godoy
Date:
Subject: Re: need some help on figuring out how to write a query