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

Re: [HACKERS] PostgreSQL pre-7.1 Linux/Alpha Status...

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ryan Kirkpatrick <pgsql(at)rkirkpat(dot)net>, pgsql-hackers(at)postgresql(dot)org, pgsql-ports(at)postgresql(dot)org
Subject: Re: [HACKERS] PostgreSQL pre-7.1 Linux/Alpha Status...
Date: 2000-12-20 17:25:31
Message-ID: 200012201725.MAA17629@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-ports
> Ryan Kirkpatrick <pgsql(at)rkirkpat(dot)net> writes:
> > INSERT INTO OID_TBL(f1) VALUES ('-1040');
> > ERROR:  oidin: error reading "-1040": value too large
> 
> That's coming from a possibly-misguided error check that I put into
> oidin():
> 
> 	unsigned long cvt;
> 	char	   *endptr;
> 
> 	cvt = strtoul(s, &endptr, 10);
> 
> 	...
> 
> 	/*
> 	 * Cope with possibility that unsigned long is wider than Oid.
> 	 */
> 	result = (Oid) cvt;
> 	if ((unsigned long) result != cvt)
> 		elog(ERROR, "oidin: error reading \"%s\": value too large", s);
> 
> On a 32-bit machine, -1040 converts to 4294966256, but on a 64-bit
> machine it converts to 2^64-1040, and the test is accordingly deciding
> that that value won't fit in an Oid.
> 
> Not sure what to do about this.  If you had actually typed 2^64-1040,
> it would be appropriate for the code to reject it.  But I hadn't
> realized that the extra check would introduce a discrepancy between
> 32- and 64-bit machines for negative inputs.  Maybe it'd be better just
> to delete the check.  Comments anyone?

Can't we just say out of range, rather than too large?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  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

pgsql-ports by date

Next:From: Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=Date: 2000-12-20 22:35:29
Subject: Re: [HACKERS] RPM changes for 7.1.
Previous:From: Magnus Naeslund(f)Date: 2000-12-20 16:58:27
Subject: Re: PostgreSQL pre-7.1 Linux/Alpha Status...

pgsql-hackers by date

Next:From: Stephan SzaboDate: 2000-12-20 17:36:49
Subject: Re: CHECK constraint names
Previous:From: Magnus Naeslund(f)Date: 2000-12-20 16:58:27
Subject: Re: PostgreSQL pre-7.1 Linux/Alpha Status...

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