pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: Nicolas Huillard <nhuillard@ghs.fr>
Cc: pgsql-general@hub.org
Cc: pgsql-sql@hub.org
Subject: RE: [GENERAL] Problem with SELECT on large negative INT4
Date: Fri, 28 Jan 2000 01:30:57 +0900
Message-ID: <NDBBIJLOILGIKBGDINDFAEGLCCAA.Inoue@tpf.co.jp> (raw)
In-Reply-To: <01BF68CB.9C1C3F90@agen.int.ghs>

> -----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

inline patch 1: nbtcompare.c 2000/01/19 05:42:06 (+6/-1 lines) download inline-1.patch*** 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

view thread (18+ messages)  latest in thread

Message-ID: <NDBBIJLOILGIKBGDINDFAEGLCCAA.Inoue@tpf.co.jp>
Permalink:  ../NDBBIJLOILGIKBGDINDFAEGLCCAA.Inoue@tpf.co.jp/
Also on:    postgresql.org/message-id/NDBBIJLOILGIKBGDINDFAEGLCCAA.Inoue@tpf.co.jp

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: Inoue@tpf.co.jp, nhuillard@ghs.fr, pgsql-general@hub.org, pgsql-sql@hub.org
  Subject: Re: [GENERAL] Problem with SELECT on large negative INT4
  In-Reply-To: <NDBBIJLOILGIKBGDINDFAEGLCCAA.Inoue@tpf.co.jp>
  References: <01BF68CB.9C1C3F90@agen.int.ghs> <NDBBIJLOILGIKBGDINDFAEGLCCAA.Inoue@tpf.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox