Skip site navigation (1) Skip section navigation (2)

Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: Nicolas Huillard <nhuillard(at)ghs(dot)fr>, pgsql-general(at)hub(dot)org, pgsql-sql(at)hub(dot)org
Subject: Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4
Date: 2000-01-27 16:37:24
Message-ID: 200001271637.LAA23266@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-sql
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> > -----Original Message-----
> > From: owner-pgsql-general(at)postgresql(dot)org
> > [mailto:owner-pgsql-general(at)postgresql(dot)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 ?

Hiroshi, I don't see this in the main tree, nor do I see it having been
requested for application. Should I apply it?

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


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2000-01-27 17:41:45
Subject: Re: [HACKERS] Column ADDing issues
Previous:From: Hiroshi InoueDate: 2000-01-27 16:30:57
Subject: RE: [GENERAL] Problem with SELECT on large negative INT4

pgsql-sql by date

Next:From: uihtotDate: 2000-01-27 17:18:34
Subject: 18 yr. old blonde 5963
Previous:From: Hiroshi InoueDate: 2000-01-27 16:30:57
Subject: RE: [GENERAL] Problem with SELECT on large negative INT4

pgsql-general by date

Next:From: Mel WilsonDate: 2000-01-27 17:08:50
Subject: Re: [GENERAL] Trouble: subquery doesn't terminate
Previous:From: Bruce BantosDate: 2000-01-27 16:35:02
Subject: backup/maintenance scripts?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group