mohayu22 commented on code in PR #895:
URL: https://github.com/apache/age/pull/895#discussion_r1189343011
##########
regress/expected/expr.out:
##########
@@ -1667,6 +1667,135 @@ SELECT agtype_in('[NaN, {"e": 2.718281::numeric, "one":
Infinity, "pie": 3.14159
[NaN, {"e": 2.718281::numeric, "one": Infinity, "pie": 3.1415927},
2::numeric, null]
(1 row)
+--
+-- Test typecast ::pg_float8
+--
+SELECT * FROM cypher('expr', $$
+RETURN 0::pg_float8
+$$) AS r(result agtype);
+ result
+--------
+ 0.0
+(1 row)
+
+SELECT * FROM cypher('expr', $$
+RETURN '2.71'::pg_float8
+$$) AS r(result agtype);
+ result
+--------
+ 2.71
+(1 row)
+
+SELECT * FROM cypher('expr', $$
+RETURN 2.71::pg_float8
+$$) AS r(result agtype);
+ result
+--------
+ 2.71
+(1 row)
+
+SELECT * FROM cypher('expr', $$
+RETURN ([0, {one: 1, pie: 3.1415927, e: 2::numeric}, 2,
null][1].one)::pg_float8
+$$) AS r(result agtype);
+ result
+--------
+ 1.0
+(1 row)
+
+SELECT * FROM cypher('expr', $$
+RETURN ([0, {one: 1::pg_float8, pie: 3.1415927, e: 2.718281::numeric}, 2,
null][1].one)
+$$) AS r(result agtype);
+ result
+--------
+ 1.0
+(1 row)
+
+SELECT * FROM cypher('expr', $$
+RETURN ([0, {one: 1::pg_float8, pie: 3.1415927, e: 2.718281::numeric}, 2,
null][1].one)::float
+$$) AS r(result agtype);
+ result
+--------
+ 1.0
+(1 row)
+
+SELECT * FROM cypher('expr', $$
+RETURN ([0, {one: 1, pie: 3.1415927, e: 2.718281::numeric}, 2,
null][3])::pg_float8
Review Comment:
Added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]