Received: from lectoure.ghs.fr (IDENT:root@e009.paris-88.cybercable.fr [212.198.88.9]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA25102; Thu, 27 Jan 2000 12:52:15 -0500 (EST) (envelope-from nhuillard@ghs.fr) Received: from agen.int.ghs (agen.int.ghs [192.168.200.21]) by lectoure.ghs.fr (8.8.7/8.8.7) with SMTP id SAA31602; Thu, 27 Jan 2000 18:52:09 +0100 Received: by agen.int.ghs with Microsoft Mail id <01BF68F7.9D1CE2B0@agen.int.ghs>; Thu, 27 Jan 2000 18:52:09 +0100 Message-ID: <01BF68F7.9D1CE2B0@agen.int.ghs> From: Nicolas Huillard To: "pgsql-general@hub.org" , "pgsql-sql@hub.org" Subject: RE: [GENERAL] Problem with SELECT on large negative INT4 Date: Thu, 27 Jan 2000 18:52:07 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id MAC25307 I haven't got the opportunity to recompile Postgres right now, but will do that. Just reading the code, I can't figure out the exact difference, but who knows... Did someone already applied this ? Nicolas Huillard -----Message d'origine----- De: Hiroshi Inoue [SMTP:Inoue@tpf.co.jp] Date: jeudi 27 janvier 2000 17:31 À: Nicolas Huillard Cc: pgsql-general@hub.org; pgsql-sql@hub.org Objet: RE: [GENERAL] Problem with SELECT on large negative INT4 > -----Original Message----- > From: owner-pgsql-general@postgresql.org > [mailto:owner-pgsql-general@postgresql.org]On Behalf Of Nicolas Huillard > > I have a DB with is updated using MS Access. Primary keys are > Int4 with default random values ("NuméroAuto" + "Aléatoire" in Access). > The DB is migrated as-is in Postgres, with tbl_prod.cle_prod > field containing values from -2057496808 to 2139583719. > When I SELECT in the table, using the INT4 cle_prod value, PG > doesn't find the tuple. When I SELECT using the VARCHAR(10) > ref_prod value, PG finds the tuple, and show the right value for > the cle_prod filed : the same as the one I SELECTed for... > > This sounds like the long negative integer values given in PSQL > is not converted correctly while executing. > Using a long positive integer value, all works like a charm... > > Below is the queries type sto sho what append. > I'm using Postgres 6.5.2 from the RPMs. > Could you try the follwoing patch ? Regards. Hiroshi Inoue *** nbtcompare.c 2000/01/11 03:33:34 1.3 --- nbtcompare.c 2000/01/19 05:42:06 *************** *** 34,40 **** int32 btint4cmp(int32 a, int32 b) { ! return a - b; } int32 --- 34,45 ---- int32 btint4cmp(int32 a, int32 b) { ! if (a > b) ! return 1; ! else if (a == b) ! return 0; ! else ! return -1; } int32 ************