]> granicus.if.org Git - postgresql/commitdiff
Add regression test to see if the min/max values of int8 convert correctly.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Dec 2005 04:13:38 +0000 (04:13 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Dec 2005 04:13:38 +0000 (04:13 +0000)
src/test/regress/expected/int8-exp-three-digits.out
src/test/regress/expected/int8.out
src/test/regress/sql/int8.sql

index ff147792621675f4bc22ed74845059c6885aa90d..e3697f8344f420b6b408db0a7d6d17b82abb706f 100644 (file)
@@ -300,3 +300,20 @@ SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999')     FROM INT8_TBL;
             | 456789-0123456789
 (5 rows)
 
+-- check min/max values
+select '-9223372036854775808'::int8;
+         int8         
+----------------------
+ -9223372036854775808
+(1 row)
+
+select '-9223372036854775809'::int8;
+ERROR:  value "-9223372036854775809" is out of range for type bigint
+select '9223372036854775807'::int8;
+        int8         
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR:  value "9223372036854775808" is out of range for type bigint
index c62d133074197ddc3e5572e1890beb05aa8ab62b..52cdabab7499683953934a267a28525e78b5a8a7 100644 (file)
@@ -300,3 +300,20 @@ SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999')     FROM INT8_TBL;
             | 456789-0123456789
 (5 rows)
 
+-- check min/max values
+select '-9223372036854775808'::int8;
+         int8         
+----------------------
+ -9223372036854775808
+(1 row)
+
+select '-9223372036854775809'::int8;
+ERROR:  value "-9223372036854775809" is out of range for type bigint
+select '9223372036854775807'::int8;
+        int8         
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR:  value "9223372036854775808" is out of range for type bigint
index 4642c012cdc87fb1e9540027f25047122c708a12..8ef92ba3f32570910fd79961ab6d3c83f7917bc2 100644 (file)
@@ -63,3 +63,9 @@ SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
 SELECT '' AS to_char_15, to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
 SELECT '' AS to_char_16, to_char(q2, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
 SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999')     FROM INT8_TBL;
+
+-- check min/max values
+select '-9223372036854775808'::int8;
+select '-9223372036854775809'::int8;
+select '9223372036854775807'::int8;
+select '9223372036854775808'::int8;