Re: BUG #15458: pg_typeof inconsistency on negative integer constant limits

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: elprans(at)gmail(dot)com, PostgreSQL Bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15458: pg_typeof inconsistency on negative integer constant limits
Date: 2018-10-26 06:02:59
Message-ID: alpine.DEB.2.21.1810260759520.27686@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2018-10-26 06:24:30 Re: BUG #15458: pg_typeof inconsistency on negative integer constant limits
Previous Message PG Bug reporting form 2018-10-26 05:33:29 BUG #15459: no connection to the server