From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
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-21 17:29:20 |
Message-ID: | Pine.LNX.4.30.0012211825200.775-100000@peter.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-ports |
Tom Lane writes:
> 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 (sizeof(unsigned long) > sizeof(Oid) && cvt > UINT_MAX)
> 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.
--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/
From | Date | Subject | |
---|---|---|---|
Next Message | Rod Taylor | 2000-12-21 17:33:10 | Inline Comments for pg_dump |
Previous Message | Alex Pilosov | 2000-12-21 17:10:58 | Re: CIDR output format |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-12-21 17:56:35 | Re: PostgreSQL pre-7.1 Linux/Alpha Status... |
Previous Message | Tom Lane | 2000-12-21 15:24:44 | Re: AW: PostgreSQL pre-7.1 Linux/Alpha Status... |