aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/expected/numeric.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/expected/numeric.out')
-rw-r--r--src/test/regress/expected/numeric.out53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/test/regress/expected/numeric.out b/src/test/regress/expected/numeric.out
index e1c7361b64a..bf3bb441afc 100644
--- a/src/test/regress/expected/numeric.out
+++ b/src/test/regress/expected/numeric.out
@@ -670,6 +670,18 @@ SELECT AVG(val) FROM num_data;
-13430913.592242320700
(1 row)
+SELECT STDDEV(val) FROM num_data;
+ stddev
+-------------------------------
+ 27791203.28758835329805617386
+(1 row)
+
+SELECT VARIANCE(val) FROM num_data;
+ variance
+--------------------------------------
+ 772350980172061.69659105821915863601
+(1 row)
+
-- Check for appropriate rounding and overflow
CREATE TABLE fract_only (id int, val numeric(4,4));
INSERT INTO fract_only VALUES (1, '0.0');
@@ -1112,3 +1124,44 @@ SELECT '' AS to_number_13, to_number(' . 0 1 -', ' 9 9 . 9 9 S');
| -0.01
(1 row)
+--
+-- Input syntax
+--
+CREATE TABLE num_input_test (n1 numeric);
+-- good inputs
+INSERT INTO num_input_test(n1) VALUES (' 123');
+INSERT INTO num_input_test(n1) VALUES (' 3245874 ');
+INSERT INTO num_input_test(n1) VALUES (' -93853');
+INSERT INTO num_input_test(n1) VALUES ('555.50');
+INSERT INTO num_input_test(n1) VALUES ('-555.50');
+INSERT INTO num_input_test(n1) VALUES ('NaN ');
+ERROR: invalid input syntax for type numeric: "NaN "
+INSERT INTO num_input_test(n1) VALUES (' nan');
+ERROR: invalid input syntax for type numeric: " nan"
+-- bad inputs
+INSERT INTO num_input_test(n1) VALUES (' ');
+ERROR: invalid input syntax for type numeric: " "
+INSERT INTO num_input_test(n1) VALUES (' 1234 %');
+ERROR: invalid input syntax for type numeric: " 1234 %"
+INSERT INTO num_input_test(n1) VALUES ('xyz');
+ERROR: invalid input syntax for type numeric: "xyz"
+INSERT INTO num_input_test(n1) VALUES ('- 1234');
+ERROR: invalid input syntax for type numeric: "- 1234"
+INSERT INTO num_input_test(n1) VALUES ('5 . 0');
+ERROR: invalid input syntax for type numeric: "5 . 0"
+INSERT INTO num_input_test(n1) VALUES ('5. 0 ');
+ERROR: invalid input syntax for type numeric: "5. 0 "
+INSERT INTO num_input_test(n1) VALUES ('');
+ERROR: invalid input syntax for type numeric: ""
+INSERT INTO num_input_test(n1) VALUES (' N aN ');
+ERROR: invalid input syntax for type numeric: " N aN "
+SELECT * FROM num_input_test;
+ n1
+---------
+ 123
+ 3245874
+ -93853
+ 555.50
+ -555.50
+(5 rows)
+