BUG #15071: Error in PostgreSQL-specific :: type cast - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #15071: Error in PostgreSQL-specific :: type cast
Date
Msg-id 151878227914.1391.18108972186680794975@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #15071: Error in PostgreSQL-specific :: type cast  (Daniel Gustafsson <daniel@yesql.se>)
Re: BUG #15071: Error in PostgreSQL-specific :: type cast  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15071
Logged by:          Yuriy Beliy
Email address:      whiteman.kr@gmail.com
PostgreSQL version: 10.1
Operating system:   Windows 10
Description:

PostgreSQL-specific :: type casts for lowest values of integer types are
produce "Out of range" errors:

SELECT -32768::smallint
^ERROR:  smallint out of range

SELECT -2147483648::integer
^ERROR:  integer out of range

SELECT     -9223372036854775808::bigint
^ERROR:  bigint out of range

Standard-syntax type casts are workes correctly:

SELECT cast(-32768 as smallint)
^Ok

SELECT cast(-2147483648 as integer)
^Ok

SELECT     cast(-9223372036854775808 as bigint)
^Ok

For highest values (+32767, +2147483647, +9223372036854775807) - :: type
cast works correctly.




pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15070: description
Next
From: Daniel Gustafsson
Date:
Subject: Re: BUG #15071: Error in PostgreSQL-specific :: type cast