BUG #1608: integer negative limit in plpgsql function arguments

From: "Paul" <paul(at)allinea(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1608: integer negative limit in plpgsql function arguments
Date: 2005-04-20 14:46:51
Message-ID: 20050420144651.3BDEAF0F4C@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1608
Logged by: Paul
Email address: paul(at)allinea(dot)com
PostgreSQL version: 8.0.2
Operating system: Gentoo and Fedora Core 3
Description: integer negative limit in plpgsql function arguments
Details:

The script below best sums up the problem (and the work around). The
question is: should I use that for all integers being put into a function?

8<--------------------------------------------

create table test (
test_id integer
);

insert into test (test_id) values (-2147483648);

create function print_test_id (integer) returns integer
AS '
DECLARE
tmp ALIAS FOR $1;
val integer;
BEGIN
select into val test_id from test where test_id = tmp;
return val;
END;
'
LANGUAGE plpgsql;

-- this doesn't work (and I think it should!)
SELECT print_test_id(-2147483648);

-- this is the workaround
SELECT print_test_id((-2147483648)::int);

-------------------------------------------->8

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Oliver Siegmar 2005-04-20 15:04:32 BUG #1609: Bug in interval datatype for 64 Bit timestamps
Previous Message sawait 2005-04-20 08:47:01 Re: BUG #1605: Is this a bug of PostgreSQL?Or, is the parameter of Windows set?