--
-- FLOAT4
--
-- bad special inputs
SELECT 'N A N'::float4;
psql:/home/runner/.ya/build/build_root/f6zk/0031e5/environment/arcadia/ydb/tests/functional/postgresql/cases/float4.sql:6: Status: PRECONDITION_FAILED
Issues: 
<main>: Error: Terminate was called, reason(52): ERROR:  invalid input syntax for type real: "N A N"



SELECT 'NaN x'::float4;
psql:/home/runner/.ya/build/build_root/f6zk/0031e5/environment/arcadia/ydb/tests/functional/postgresql/cases/float4.sql:7: Status: PRECONDITION_FAILED
Issues: 
<main>: Error: Terminate was called, reason(52): ERROR:  invalid input syntax for type real: "NaN x"



SELECT ' INFINITY    x'::float4;
psql:/home/runner/.ya/build/build_root/f6zk/0031e5/environment/arcadia/ydb/tests/functional/postgresql/cases/float4.sql:8: Status: PRECONDITION_FAILED
Issues: 
<main>: Error: Terminate was called, reason(61): ERROR:  invalid input syntax for type real: " INFINITY    x"



-- test edge-case coercions to integer
SELECT '32767.4'::float4::int2;
 column0 
---------
   32767
(1 row)

SELECT '32767.6'::float4::int2;
psql:/home/runner/.ya/build/build_root/f6zk/0031e5/environment/arcadia/ydb/tests/functional/postgresql/cases/float4.sql:11: Status: PRECONDITION_FAILED
Issues: 
<main>: Error: Terminate was called, reason(30): ERROR:  smallint out of range



SELECT '-32768.4'::float4::int2;
 column0 
---------
  -32768
(1 row)

SELECT '-32768.6'::float4::int2;
psql:/home/runner/.ya/build/build_root/f6zk/0031e5/environment/arcadia/ydb/tests/functional/postgresql/cases/float4.sql:13: Status: PRECONDITION_FAILED
Issues: 
<main>: Error: Terminate was called, reason(30): ERROR:  smallint out of range



SELECT '2147483520'::float4::int4;
  column0   
------------
 2147483520
(1 row)

SELECT '2147483647'::float4::int4;
psql:/home/runner/.ya/build/build_root/f6zk/0031e5/environment/arcadia/ydb/tests/functional/postgresql/cases/float4.sql:15: Status: PRECONDITION_FAILED
Issues: 
<main>: Error: Terminate was called, reason(29): ERROR:  integer out of range



SELECT '-2147483648.5'::float4::int4;
   column0   
-------------
 -2147483648
(1 row)

SELECT '-2147483900'::float4::int4;
psql:/home/runner/.ya/build/build_root/f6zk/0031e5/environment/arcadia/ydb/tests/functional/postgresql/cases/float4.sql:17: Status: PRECONDITION_FAILED
Issues: 
<main>: Error: Terminate was called, reason(29): ERROR:  integer out of range



SELECT '9223369837831520256'::float4::int8;
       column0       
---------------------
 9223369837831520256
(1 row)

SELECT '9223372036854775807'::float4::int8;
psql:/home/runner/.ya/build/build_root/f6zk/0031e5/environment/arcadia/ydb/tests/functional/postgresql/cases/float4.sql:19: Status: PRECONDITION_FAILED
Issues: 
<main>: Error: Terminate was called, reason(28): ERROR:  bigint out of range



SELECT '-9223372036854775808.5'::float4::int8;
       column0        
----------------------
 -9223372036854775808
(1 row)

SELECT '-9223380000000000000'::float4::int8;
psql:/home/runner/.ya/build/build_root/f6zk/0031e5/environment/arcadia/ydb/tests/functional/postgresql/cases/float4.sql:21: Status: PRECONDITION_FAILED
Issues: 
<main>: Error: Terminate was called, reason(28): ERROR:  bigint out of range



