summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorStephen Frost2014-09-29 17:32:22 +0000
committerStephen Frost2014-09-29 17:32:22 +0000
commitc8a026e4f15e2063cd7fe6cb9ffe44f2a81398bd (patch)
tree7eafaecf26e876c7be72bd666fbb24adb8a097ae /src/test
parentdef4c28cf9147472ba4cfc5b68a098d7a29fb0fb (diff)
Revert 95d737ff to add 'ignore_nulls'
Per discussion, revert the commit which added 'ignore_nulls' to row_to_json. This capability would be better added as an independent function rather than being bolted on to row_to_json. Additionally, the implementation didn't address complex JSON objects, and so was incomplete anyway. Pointed out by Tom and discussed with Andrew and Robert.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/json.out58
-rw-r--r--src/test/regress/sql/json.sql24
2 files changed, 0 insertions, 82 deletions
diff --git a/src/test/regress/expected/json.out b/src/test/regress/expected/json.out
index 968e02a1e1..bb4d9ed4be 100644
--- a/src/test/regress/expected/json.out
+++ b/src/test/regress/expected/json.out
@@ -397,70 +397,12 @@ FROM rows q;
"y":"txt3"}
(3 rows)
-SELECT row_to_json(q,pretty := true)
-FROM rows q;
- row_to_json
---------------
- {"x":1, +
- "y":"txt1"}
- {"x":2, +
- "y":"txt2"}
- {"x":3, +
- "y":"txt3"}
-(3 rows)
-
SELECT row_to_json(row((select array_agg(x) as d from generate_series(5,10) x)),false);
row_to_json
-----------------------
{"f1":[5,6,7,8,9,10]}
(1 row)
-WITH x AS (SELECT a,b,c FROM (VALUES(10,20,30),
- (10,NULL, NULL),
- (NULL, NULL, NULL)) g(a,b,c))
- SELECT row_to_json(x, false, false) FROM x;
- row_to_json
-------------------------------
- {"a":10,"b":20,"c":30}
- {"a":10,"b":null,"c":null}
- {"a":null,"b":null,"c":null}
-(3 rows)
-
-WITH x AS (SELECT a,b,c FROM (VALUES(10,20,30),
- (10,NULL, NULL),
- (NULL, NULL, NULL)) g(a,b,c))
- SELECT row_to_json(x, false, true) FROM x;
- row_to_json
-------------------------
- {"a":10,"b":20,"c":30}
- {"a":10}
- {}
-(3 rows)
-
-WITH x AS (SELECT a,b,c FROM (VALUES(10,20,30),
- (10,NULL, NULL),
- (NULL, NULL, NULL)) g(a,b,c))
- SELECT row_to_json(x, ignore_nulls := true) FROM x;
- row_to_json
-------------------------
- {"a":10,"b":20,"c":30}
- {"a":10}
- {}
-(3 rows)
-
-WITH x AS (SELECT a,b,c FROM (VALUES(10,20,30),
- (10,NULL, NULL),
- (NULL, NULL, NULL)) g(a,b,c))
- SELECT row_to_json(x, ignore_nulls := true, pretty := true) FROM x;
- row_to_json
--------------
- {"a":10, +
- "b":20, +
- "c":30}
- {"a":10}
- {}
-(3 rows)
-
-- to_json, timestamps
select to_json(timestamp '2014-05-28 12:22:35.614298');
to_json
diff --git a/src/test/regress/sql/json.sql b/src/test/regress/sql/json.sql
index 3ddf6564e0..c9801321e0 100644
--- a/src/test/regress/sql/json.sql
+++ b/src/test/regress/sql/json.sql
@@ -98,32 +98,8 @@ FROM generate_series(1,3) AS x;
SELECT row_to_json(q,true)
FROM rows q;
-SELECT row_to_json(q,pretty := true)
-FROM rows q;
-
SELECT row_to_json(row((select array_agg(x) as d from generate_series(5,10) x)),false);
-WITH x AS (SELECT a,b,c FROM (VALUES(10,20,30),
- (10,NULL, NULL),
- (NULL, NULL, NULL)) g(a,b,c))
- SELECT row_to_json(x, false, false) FROM x;
-
-WITH x AS (SELECT a,b,c FROM (VALUES(10,20,30),
- (10,NULL, NULL),
- (NULL, NULL, NULL)) g(a,b,c))
- SELECT row_to_json(x, false, true) FROM x;
-
-WITH x AS (SELECT a,b,c FROM (VALUES(10,20,30),
- (10,NULL, NULL),
- (NULL, NULL, NULL)) g(a,b,c))
- SELECT row_to_json(x, ignore_nulls := true) FROM x;
-
-WITH x AS (SELECT a,b,c FROM (VALUES(10,20,30),
- (10,NULL, NULL),
- (NULL, NULL, NULL)) g(a,b,c))
- SELECT row_to_json(x, ignore_nulls := true, pretty := true) FROM x;
-
-
-- to_json, timestamps
select to_json(timestamp '2014-05-28 12:22:35.614298');