Re: documentation for hashtext? - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: documentation for hashtext?
Date
Msg-id 1314444596.2349.7.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: documentation for hashtext?  ("Massa, Harald Armin" <harald@2ndQuadrant.de>)
List pgsql-general
On tor, 2011-08-25 at 14:05 +0200, Massa, Harald Armin wrote:
> > conclusion was that it's not documented because it's internal and
> > you're not supposed to use/rely on it.
> >
> > My impression is that people are allready using it, relying their sharding
> on it, even building indexes on it.

I think a better solution is either to implement lookup3 in PostgreSQL,
which is what hashtext was originally based on, so you have a hash
function that won't change and is comparable to the current one in
behavior.  Or you use a standard cryptographic hash function such as md5
or sha1 and shard by that.  They are slower than the lookup3-type hash
functions, but for multiple-node applications, it's probably OK.

> So... I suggest we start documenting it. Even if there was a
> recommendation not to use it, people will get hurt anyway if their
> application rely on it and it breaks.

Well, it's already broken for what people are using it or are thinking
about using it, and documenting it won't help that.  Better come up with
a purpose-built solution, as per above.



pgsql-general by date:

Previous
From: José María Terry Jiménez
Date:
Subject: Re: Performing upgrade to latest minor release using PGDG RPMs
Next
From: "Maton, Brett"
Date:
Subject: Re: Performing upgrade to latest minor release using PGDG RPMs