Re: migrate hashname function from 8.1.x to 8.4

From: nicolas(dot)garfinkiel(at)genesis-manlab(dot)com(dot)ar
To: pgsql-general(at)postgresql(dot)org
Subject: Re: migrate hashname function from 8.1.x to 8.4
Date: 2011-01-11 04:02:18
Message-ID: 4AFFC56900042BEF@ms2.iplannetworks.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Craig,

Thank you for your reply!

well, what i mean is that hashname() function would return a different value
depending the pgsql version.

Consider this query (note that i'm using some extra implicit cast functions
here):

SELECT password FROM user WHERE password = hashname('AZALEA')
UNION ALL
SELECT hashname('AZALEA')::text;

in 8.1.x it returns:

"-588380923"
"-588380923"

whereas in 8.4 this query only returns:

"-10546138"

And tweaking the query to show the difference more clearly:

SELECT password FROM user WHERE login = 'SIST'
UNION ALL
SELECT hashname('AZALEA')::text;

this returns:

"-588380923"
"-10546138"

Am I missing something?

Just a side note: our goal with this upgrade is to improve our system's performance
and stability (which 8.1 is not) while not embarking in any kind of refactoring,
as plans are underway to develop a new system. what we are looking for is
just a quick fix, if there's such thing out there!

Any thoughts?

Original Message --
>Date: Tue, 11 Jan 2011 10:25:59 +1100
>From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
>To: Nicolas Garfinkiel <nicolas(dot)garfinkiel(at)genesis-manlab(dot)com(dot)ar>
>CC: pgsql-general(at)postgresql(dot)org
>Subject: Re: [GENERAL] migrate hashname function from 8.1.x to 8.4
>
>
>On 01/11/2011 02:09 AM, Nicolas Garfinkiel wrote:
>> Hi all,
>>
>> I?m trying to upgrade our pgsql from 8.1 to 8.4, but our system?s login
>> uses the hashname() function in order to get the proper password
>> validation. Now pgsql?s 8.4 hashname function is not compatible with
>> 8.1?s function. Do you have any ideas how I can reproduce 8.1 function
>> in 8.4?
>
>In what regard is it 'not compatible' ?
>
>Please provide output from 8.1 and 8.4 for one of the samples you're
>using, along with an explanation of what's causing you problems.
>
>--
>Craig Ringer
>
>--
>Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>To make changes to your subscription:
>http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message J. Hondius 2011-01-11 08:23:13 Mixed client_encoding database: what to do with..
Previous Message Karayappalli, Raghunath (Raghu) 2011-01-11 03:03:13 database is growing... 1GB per day basis