You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select id, (test_json_dot.test_json).b, json_query(test_json, 'lax $.b' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2727
-
id | b | expected
2728
-
----+-------------+-------------
2728
+
select id, (test_json).b, json_query(test_json, 'lax $.b' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2729
+
id | b | expected
2730
+
----+-------------+-----------------
2729
2731
1 | 42 | 42
2730
2732
2 | {"c": 42} | {"c": 42}
2731
2733
3 | {"c": "42"} | {"c": "42"}
2732
2734
4 | {"c": "42"} | {"c": "42"}
2733
-
(4 rows)
2735
+
5 | | [42, {"c": 42}]
2736
+
(5 rows)
2734
2737
2735
-
select id, (test_json_dot.test_json).b.c, json_query(test_json, 'lax $.b.c' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2738
+
select id, (test_json).b.c, json_query(test_json, 'lax $.b.c' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2736
2739
id | c | expected
2737
2740
----+------+----------
2738
2741
1 | |
2739
2742
2 | 42 | 42
2740
2743
3 | "42" | "42"
2741
2744
4 | "42" | "42"
2742
-
(4 rows)
2745
+
5 | | 42
2746
+
(5 rows)
2743
2747
2744
-
select id, (test_json_dot.test_json).d, json_query(test_json, 'lax $.d' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2748
+
select id, (test_json).d, json_query(test_json, 'lax $.d' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
select id, (test_json_dot.test_json)."d", json_query(test_json, 'lax $.d' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2758
+
select id, (test_json)."d", json_query(test_json, 'lax $."d"' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
select id, (test_json_dot.test_json).'d' from test_json_dot;
2768
+
select id, (test_json).'d' from test_json_dot;
2763
2769
ERROR: syntax error at or near "'d'"
2764
-
LINE 1: select id, (test_json_dot.test_json).'d' from test_json_dot;
2765
-
^
2766
-
select id, (test_json_dot.test_json)['d'] from test_json_dot;
2770
+
LINE 1: select id, (test_json).'d' from test_json_dot;
2771
+
^
2772
+
select id, (test_json)['d'] from test_json_dot;
2767
2773
ERROR: json subscript must be coercible to integer
2768
-
LINE 1: select id, (test_json_dot.test_json)['d'] from test_json_dot...
2769
-
^
2774
+
LINE 1: select id, (test_json)['d'] from test_json_dot;
2775
+
^
2770
2776
-- wildcard access is not supported
2771
-
select (test_json_dot.test_json).* from test_json_dot;
2777
+
select (test_json).* from test_json_dot;
2772
2778
ERROR: type json is not composite
2773
2779
-- array element access
2774
-
select id, (test_json_dot.test_json).d[0], json_query(test_json, 'lax $.d[0]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2780
+
select id, (test_json).d[0], json_query(test_json, 'lax $.d[0]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2775
2781
id | d | expected
2776
2782
----+-----------------+-----------------
2777
2783
1 | |
2778
2784
2 | |
2779
2785
3 | 11 | 11
2780
2786
4 | {"x": [11, 12]} | {"x": [11, 12]}
2781
-
(4 rows)
2787
+
5 | |
2788
+
(5 rows)
2782
2789
2783
-
select id, (test_json_dot.test_json).d[1], json_query(test_json, 'lax $.d[1]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2790
+
select id, (test_json).d[1], json_query(test_json, 'lax $.d[1]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2784
2791
id | d | expected
2785
2792
----+-----------------+-----------------
2786
2793
1 | |
2787
2794
2 | |
2788
2795
3 | 12 | 12
2789
2796
4 | {"y": [21, 22]} | {"y": [21, 22]}
2790
-
(4 rows)
2797
+
5 | |
2798
+
(5 rows)
2791
2799
2792
-
select id, (test_json_dot.test_json).d[0:] from test_json_dot;
2800
+
select id, (test_json).d[0:] from test_json_dot;
2793
2801
ERROR: json subscript does not support slices
2794
-
LINE 1: select id, (test_json_dot.test_json).d[0:] from test_json_do...
2802
+
LINE 1: select id, (test_json).d[0:] from test_json_dot;
2795
2803
^
2796
-
select id, (test_json_dot.test_json).d[0::int] from test_json_dot;
2804
+
select id, json_query(test_json, 'lax $.d[0:]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) from test_json_dot;
2805
+
ERROR: syntax error at or near ":" of jsonpath input
2806
+
LINE 1: select id, json_query(test_json, 'lax $.d[0:]' WITH CONDITIO...
2807
+
^
2808
+
select id, (test_json).d[0::int] from test_json_dot;
2797
2809
id | d
2798
2810
----+-----------------
2799
2811
1 |
2800
2812
2 |
2801
2813
3 | 11
2802
2814
4 | {"x": [11, 12]}
2803
-
(4 rows)
2815
+
5 |
2816
+
(5 rows)
2804
2817
2805
-
select id, (test_json_dot.test_json).d[0::float] from test_json_dot;
2818
+
select id, json_query(test_json, 'lax $.d[0::int]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) from test_json_dot;
2819
+
ERROR: syntax error at or near ":" of jsonpath input
2820
+
LINE 1: select id, json_query(test_json, 'lax $.d[0::int]' WITH COND...
2821
+
^
2822
+
select id, (test_json).d[0::float] from test_json_dot;
2806
2823
ERROR: json subscript must be coercible to integer
2807
-
LINE 1: select id, (test_json_dot.test_json).d[0::float] from test_j...
2808
-
^
2809
-
select id, (test_json_dot.test_json).d[0].x[1], json_query(test_json, 'lax $.d[0].x[1]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
2824
+
LINE 1: select id, (test_json).d[0::float] from test_json_dot;
2825
+
^
2826
+
select id, (test_json).d[0].x[1], json_query(test_json, 'lax $.d[0].x[1]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_dot;
select id, (test_json_domain_dot.compjd).f2.key1.c from test_json_domain_dot;
2827
-
id | c
2828
-
----+------
2829
-
1 | "42"
2830
-
2 | "42"
2831
-
3 |
2844
+
select id, (compjd).f2.key1.c, json_query((compjd).f2, 'lax $.key1.c' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_domain_dot;
2845
+
id | c | expected
2846
+
----+------+----------
2847
+
1 | "42" | "42"
2848
+
2 | "42" | "42"
2849
+
3 | | "42"
2832
2850
(3 rows)
2833
2851
2834
-
select id, (test_json_domain_dot.compjd).f2.key2 from test_json_domain_dot;
2835
-
id | key2
2836
-
----+---------------------------
2837
-
1 | [11, 12]
2838
-
2 | [11, 12, {"x": [31, 42]}]
2839
-
3 |
2852
+
select id, (compjd).f2.key2, json_query((compjd).f2, 'lax $.key2' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_domain_dot;
select id, (test_json_domain_dot.compjd).f2.key2[0] from test_json_domain_dot;
2843
-
id | key2
2844
-
----+------
2845
-
1 | 11
2846
-
2 | 11
2847
-
3 |
2860
+
select id, (compjd).f2.key2[0], json_query((compjd).f2, 'lax $.key2[0]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_domain_dot;
2861
+
id | key2 | expected
2862
+
----+------+----------
2863
+
1 | 11 | 11
2864
+
2 | 11 | 11
2865
+
3 | | 11
2848
2866
(3 rows)
2849
2867
2850
-
select id, (test_json_domain_dot.compjd).f2.key2[0::text] from test_json_domain_dot;
2868
+
select id, (compjd).f2.key2[0::text] from test_json_domain_dot;
2851
2869
ERROR: json subscript must be coercible to integer
2852
-
LINE 1: select id, (test_json_domain_dot.compjd).f2.key2[0::text] fr...
2853
-
^
2854
-
select id, (test_json_domain_dot.compjd).f2.key2[2].x[1] from test_json_domain_dot;
2855
-
id | x
2856
-
----+----
2857
-
1 |
2858
-
2 | 42
2859
-
3 |
2870
+
LINE 1: select id, (compjd).f2.key2[0::text] from test_json_domain_d...
2871
+
^
2872
+
select json_query((compjd).f2, 'lax $.key2[0::text]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) from test_json_domain_dot;
2873
+
ERROR: syntax error at or near ":" of jsonpath input
2874
+
LINE 1: select json_query((compjd).f2, 'lax $.key2[0::text]' WITH CO...
2875
+
^
2876
+
select id, (test_json_domain_dot.compjd).f2.key2[2].x[1], json_query((compjd).f2, 'lax $.key2[2].x[1]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_domain_dot;
2877
+
id | x | expected
2878
+
----+----+----------
2879
+
1 | |
2880
+
2 | 42 | 42
2881
+
3 | |
2860
2882
(3 rows)
2861
2883
2862
2884
-- array access
2863
-
select id, (test_json_domain_dot.compjd).f2[0] from test_json_domain_dot;
2864
-
id | f2
2865
-
----+----------
2866
-
1 |
2867
-
2 |
2868
-
3 | {"a": 3}
2885
+
select id, (compjd).f2[0], json_query((compjd).f2, 'lax $[0]' WITH CONDITIONAL WRAPPER NULL ON EMPTY NULL ON ERROR) as expected from test_json_domain_dot;
0 commit comments