Re: BUG #15458: pg_typeof inconsistency on negative integer constantlimits - Mailing list pgsql-bugs

From Fabien COELHO
Subject Re: BUG #15458: pg_typeof inconsistency on negative integer constantlimits
Date
Msg-id alpine.DEB.2.21.1810260759520.27686@lancre
Whole thread Raw
In response to Re: BUG #15458: pg_typeof inconsistency on negative integer constantlimits  (Andres Freund <andres@anarazel.de>)
Responses Re: BUG #15458: pg_typeof inconsistency on negative integer constantlimits
List pgsql-bugs
>> SELECT -2147483648::integer;
>> ERROR:  integer out of range
>
> It's just a precedence issue. :: binds with higher precedence, so the
> above is actually -(2147483648::integer), rather than
> (-2147483648)::integer. Therefore you get an overflow.

The error message may be nicer by expliciting the offending string, and/or 
locating it precisely within the query?

-- 
Fabien.


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15459: no connection to the server
Next
From: Andres Freund
Date:
Subject: Re: BUG #15458: pg_typeof inconsistency on negative integer constantlimits