Re: [PATCHES] updated hash functions for postgresql v1

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Asko Oja <ascoja(at)gmail(dot)com>, Kenneth Marshall <ktm(at)rice(dot)edu>, Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] updated hash functions for postgresql v1
Date: 2009-10-28 19:09:40
Message-ID: 1256756980.1769.17.camel@hvost1700
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2009-02-11 at 11:22 -0500, Tom Lane wrote:
> Asko Oja <ascoja(at)gmail(dot)com> writes:
> > Did this change hashtext() visible to users? We have been using it quite
> > widely for partitioning our databases. If so then it should be marked quite
> > visibly in release notes as there might be others who will be hit by this.
>
> The hash functions are undocumented, have changed in the past, and are
> likely to change again in the future. If you are using them in a way
> that depends on them to give the same answers across versions, you'd
> better stop.

Is at least the fact that they "are undocumented, have changed in the
past, and are likely to change again in the future" documented ?

I'm sure this is something that has hit unwary users in the past and
will hit again in the future, so some words about it in the doc's would
be appropriate.

search for "hashtext" on
http://www.postgresql.org/docs/8.4/interactive/index.html returned no
results, so I guess even theyr "undocumented, will surprise you" status
is not documented.

Hashing is a quite fundamental thing in computing, so I was quite
surprised to find out it had silently changed.

I had never checked the docs for hash functions, but I had assumed, that
internal functions are prefixed by pg_ and anything else is public, free
to use functionality.

Changing hash functions also makes in-place upgrades a lot harder, as
they can't be done incrementally anymore for tables which use hash
indexes.

> regards, tom lane
>
--
Hannu Krosing http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
Services, Consulting and Training

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2009-10-28 19:20:27 Re: Parsing config files in a directory
Previous Message Josh Berkus 2009-10-28 19:08:48 Re: Parsing config files in a directory