[ADMIN] how to allow integer overflow for calculating hash code of a string?

2012-09-20 Thread Haifeng Liu
I want to write a hash function which acts as String.hashCode() in java: hash = hash * 31 + s.charAt(i)... but I got integer out of range error. How can I avoid this? I saw java do not care overflow of int, it just make the result negative. -- Sent via pgsql-admin mailing list (pgsql-admin@pos

Re: [ADMIN] how to allow integer overflow for calculating hash code of a string?

2012-09-20 Thread Craig James
On Thu, Sep 20, 2012 at 1:55 AM, Haifeng Liu wrote: > I want to write a hash function which acts as String.hashCode() in java: > hash = hash * 31 + s.charAt(i)... but I got integer out of range error. How > can I avoid this? I saw java do not care overflow of int, it just make the > result negati

[ADMIN] Backup and Restore from 8.3.0 to 9.1.3

2012-09-20 Thread Kasia Tuszynska
Hi Everybody, I am experimenting with backups and restores I am running into something curious and would appreciate any suggestions. Backing up from: Postgres 8.3.0 Windows 2003 sp1 server (32bit) -Took a compressed binary backup of a single db (the default option in pgAdminIII, rig

Re: [ADMIN] Problem creating temporary tables . . .

2012-09-20 Thread Tom Lane
=?iso-8859-1?Q?Rub=E9n_Crespo_Flores?= writes: >>> ERROR: could not find tuple for attrdef 299038853 >>> SQL state: XX000 >>> Context: SQL statement "create temporary table tmp_tablatotlin15 (... >> Hm ... that's a bit odd, but try reindexing pg_attrdef. > I tried reindexing pg_attrdef and pg_at

Re: [ADMIN] Problem creating temporary tables . . .

2012-09-20 Thread Rubén Crespo Flores
El 20/09/2012, a las 12:36, Tom Lane escribió: > =?iso-8859-1?Q?Rub=E9n_Crespo_Flores?= writes: ERROR: could not find tuple for attrdef 299038853 SQL state: XX000 Context: SQL statement "create temporary table tmp_tablatotlin15 (... > >>> Hm ... that's a bit odd, but try reindexi

Re: [ADMIN] Problem creating temporary tables . . .

2012-09-20 Thread Tom Lane
=?iso-8859-1?Q?Rub=E9n_Crespo_Flores?= writes: > El 20/09/2012, a las 12:36, Tom Lane escribió: >> There's something awfully odd about that. A look in the 9.0 sources >> says that that specific error text only appears in RemoveAttrDefault >> and getObjectDescription - and the latter is only used

Re: [ADMIN] Backup and Restore from 8.3.0 to 9.1.3

2012-09-20 Thread Craig Ringer
On 09/21/2012 01:01 AM, Kasia Tuszynska wrote: Hi Everybody, I am experimenting with backups and restores…. I am running into something curious and would appreciate any suggestions. Backing up from: Postgres 8.3.0 Windows 2003 sp1 server (32bit) -Took a compressed binary backup of a single

Re: [ADMIN] how to allow integer overflow for calculating hash code of a string?

2012-09-20 Thread Haifeng Liu
On Sep 20, 2012, at 10:34 PM, Craig James wrote: > > > On Thu, Sep 20, 2012 at 1:55 AM, Haifeng Liu wrote: > I want to write a hash function which acts as String.hashCode() in java: hash > = hash * 31 + s.charAt(i)... but I got integer out of range error. How can I > avoid this? I saw java