@@ -1360,6 +1360,48 @@ SELECT gin_debug_query_path_value('x <@ [1,2,3]');
1360
1360
1361
1361
(1 row)
1362
1362
1363
+ SELECT gin_debug_query_path_value('x = *');
1364
+ gin_debug_query_path_value
1365
+ ----------------------------
1366
+ x = * , entry 0 +
1367
+
1368
+ (1 row)
1369
+
1370
+ SELECT gin_debug_query_path_value('x is boolean');
1371
+ gin_debug_query_path_value
1372
+ ----------------------------
1373
+ x IS boolean , entry 0 +
1374
+
1375
+ (1 row)
1376
+
1377
+ SELECT gin_debug_query_path_value('x is string');
1378
+ gin_debug_query_path_value
1379
+ ----------------------------
1380
+ x IS string , entry 0 +
1381
+
1382
+ (1 row)
1383
+
1384
+ SELECT gin_debug_query_path_value('x is numeric');
1385
+ gin_debug_query_path_value
1386
+ ----------------------------
1387
+ x IS numeric , entry 0 +
1388
+
1389
+ (1 row)
1390
+
1391
+ SELECT gin_debug_query_path_value('x is array');
1392
+ gin_debug_query_path_value
1393
+ ----------------------------
1394
+ x IS array , entry 0 +
1395
+
1396
+ (1 row)
1397
+
1398
+ SELECT gin_debug_query_path_value('x is object');
1399
+ gin_debug_query_path_value
1400
+ ----------------------------
1401
+ x IS object , entry 0 +
1402
+
1403
+ (1 row)
1404
+
1363
1405
SELECT gin_debug_query_value_path('NOT NOT NOT x(y(NOT (a=1) and NOT (b=2)) OR NOT NOT (c=3)) and z = 5');
1364
1406
gin_debug_query_value_path
1365
1407
----------------------------
@@ -1483,6 +1525,48 @@ SELECT gin_debug_query_value_path('x = [1,2,3]');
1483
1525
1484
1526
(1 row)
1485
1527
1528
+ SELECT gin_debug_query_value_path('x = *');
1529
+ gin_debug_query_value_path
1530
+ ----------------------------
1531
+ x = * , entry 0 +
1532
+
1533
+ (1 row)
1534
+
1535
+ SELECT gin_debug_query_value_path('x is boolean');
1536
+ gin_debug_query_value_path
1537
+ ----------------------------
1538
+ x IS boolean , entry 0 +
1539
+
1540
+ (1 row)
1541
+
1542
+ SELECT gin_debug_query_value_path('x is string');
1543
+ gin_debug_query_value_path
1544
+ ----------------------------
1545
+ x IS string , entry 0 +
1546
+
1547
+ (1 row)
1548
+
1549
+ SELECT gin_debug_query_value_path('x is numeric');
1550
+ gin_debug_query_value_path
1551
+ ----------------------------
1552
+ x IS numeric , entry 0 +
1553
+
1554
+ (1 row)
1555
+
1556
+ SELECT gin_debug_query_value_path('x is array');
1557
+ gin_debug_query_value_path
1558
+ ----------------------------
1559
+ x IS array , entry 0 +
1560
+
1561
+ (1 row)
1562
+
1563
+ SELECT gin_debug_query_value_path('x is object');
1564
+ gin_debug_query_value_path
1565
+ ----------------------------
1566
+ x IS object , entry 0 +
1567
+
1568
+ (1 row)
1569
+
1486
1570
---table and index
1487
1571
select count(*) from test_jsquery where (v->>'review_helpful_votes')::int4 > 0;
1488
1572
count
@@ -1606,6 +1690,18 @@ select count(*) from test_jsquery where v @@ 'similar_product_ids && ["044018029
1606
1690
4
1607
1691
(1 row)
1608
1692
1693
+ select count(*) from test_jsquery where v @@ 'similar_product_ids <@ ["B00000DG0U", "B00004SQXU", "B0001XAM18", "B00000FDBU", "B00000FDBV", "B000002H2H", "B000002H6C", "B000002H5E", "B000002H97", "B000002HMH"]';
1694
+ count
1695
+ -------
1696
+ 54
1697
+ (1 row)
1698
+
1699
+ select count(*) from test_jsquery where v @@ 'similar_product_ids @> ["B000002H2H", "B000002H6C"]';
1700
+ count
1701
+ -------
1702
+ 3
1703
+ (1 row)
1704
+
1609
1705
select count(*) from test_jsquery where v @@ 'customer_id = null';
1610
1706
count
1611
1707
-------
@@ -1624,6 +1720,42 @@ select count(*) from test_jsquery where v @@ 'product_group = false';
1624
1720
1
1625
1721
(1 row)
1626
1722
1723
+ select count(*) from test_jsquery where v @@ 't = *';
1724
+ count
1725
+ -------
1726
+ 10
1727
+ (1 row)
1728
+
1729
+ select count(*) from test_jsquery where v @@ 't is boolean';
1730
+ count
1731
+ -------
1732
+ 2
1733
+ (1 row)
1734
+
1735
+ select count(*) from test_jsquery where v @@ 't is string';
1736
+ count
1737
+ -------
1738
+ 2
1739
+ (1 row)
1740
+
1741
+ select count(*) from test_jsquery where v @@ 't is numeric';
1742
+ count
1743
+ -------
1744
+ 2
1745
+ (1 row)
1746
+
1747
+ select count(*) from test_jsquery where v @@ 't is array';
1748
+ count
1749
+ -------
1750
+ 2
1751
+ (1 row)
1752
+
1753
+ select count(*) from test_jsquery where v @@ 't is object';
1754
+ count
1755
+ -------
1756
+ 2
1757
+ (1 row)
1758
+
1627
1759
select v from test_jsquery where v @@ 'array <@ [2,3]' order by v;
1628
1760
v
1629
1761
-------------------
@@ -1746,6 +1878,18 @@ select count(*) from test_jsquery where v @@ 'similar_product_ids && ["044018029
1746
1878
4
1747
1879
(1 row)
1748
1880
1881
+ select count(*) from test_jsquery where v @@ 'similar_product_ids <@ ["B00000DG0U", "B00004SQXU", "B0001XAM18", "B00000FDBU", "B00000FDBV", "B000002H2H", "B000002H6C", "B000002H5E", "B000002H97", "B000002HMH"]';
1882
+ count
1883
+ -------
1884
+ 54
1885
+ (1 row)
1886
+
1887
+ select count(*) from test_jsquery where v @@ 'similar_product_ids @> ["B000002H2H", "B000002H6C"]';
1888
+ count
1889
+ -------
1890
+ 3
1891
+ (1 row)
1892
+
1749
1893
select count(*) from test_jsquery where v @@ 'customer_id = null';
1750
1894
count
1751
1895
-------
@@ -1764,6 +1908,42 @@ select count(*) from test_jsquery where v @@ 'product_group = false';
1764
1908
1
1765
1909
(1 row)
1766
1910
1911
+ select count(*) from test_jsquery where v @@ 't = *';
1912
+ count
1913
+ -------
1914
+ 10
1915
+ (1 row)
1916
+
1917
+ select count(*) from test_jsquery where v @@ 't is boolean';
1918
+ count
1919
+ -------
1920
+ 2
1921
+ (1 row)
1922
+
1923
+ select count(*) from test_jsquery where v @@ 't is string';
1924
+ count
1925
+ -------
1926
+ 2
1927
+ (1 row)
1928
+
1929
+ select count(*) from test_jsquery where v @@ 't is numeric';
1930
+ count
1931
+ -------
1932
+ 2
1933
+ (1 row)
1934
+
1935
+ select count(*) from test_jsquery where v @@ 't is array';
1936
+ count
1937
+ -------
1938
+ 2
1939
+ (1 row)
1940
+
1941
+ select count(*) from test_jsquery where v @@ 't is object';
1942
+ count
1943
+ -------
1944
+ 2
1945
+ (1 row)
1946
+
1767
1947
explain (costs off) select v from test_jsquery where v @@ 'array <@ [2,3]' order by v;
1768
1948
QUERY PLAN
1769
1949
---------------------------------------------------------------
@@ -1931,6 +2111,18 @@ select count(*) from test_jsquery where v @@ 'similar_product_ids && ["044018029
1931
2111
4
1932
2112
(1 row)
1933
2113
2114
+ select count(*) from test_jsquery where v @@ 'similar_product_ids <@ ["B00000DG0U", "B00004SQXU", "B0001XAM18", "B00000FDBU", "B00000FDBV", "B000002H2H", "B000002H6C", "B000002H5E", "B000002H97", "B000002HMH"]';
2115
+ count
2116
+ -------
2117
+ 54
2118
+ (1 row)
2119
+
2120
+ select count(*) from test_jsquery where v @@ 'similar_product_ids @> ["B000002H2H", "B000002H6C"]';
2121
+ count
2122
+ -------
2123
+ 3
2124
+ (1 row)
2125
+
1934
2126
select count(*) from test_jsquery where v @@ 'customer_id = null';
1935
2127
count
1936
2128
-------
@@ -1949,6 +2141,42 @@ select count(*) from test_jsquery where v @@ 'product_group = false';
1949
2141
1
1950
2142
(1 row)
1951
2143
2144
+ select count(*) from test_jsquery where v @@ 't = *';
2145
+ count
2146
+ -------
2147
+ 10
2148
+ (1 row)
2149
+
2150
+ select count(*) from test_jsquery where v @@ 't is boolean';
2151
+ count
2152
+ -------
2153
+ 2
2154
+ (1 row)
2155
+
2156
+ select count(*) from test_jsquery where v @@ 't is string';
2157
+ count
2158
+ -------
2159
+ 2
2160
+ (1 row)
2161
+
2162
+ select count(*) from test_jsquery where v @@ 't is numeric';
2163
+ count
2164
+ -------
2165
+ 2
2166
+ (1 row)
2167
+
2168
+ select count(*) from test_jsquery where v @@ 't is array';
2169
+ count
2170
+ -------
2171
+ 2
2172
+ (1 row)
2173
+
2174
+ select count(*) from test_jsquery where v @@ 't is object';
2175
+ count
2176
+ -------
2177
+ 2
2178
+ (1 row)
2179
+
1952
2180
explain (costs off) select v from test_jsquery where v @@ 'array <@ [2,3]' order by v;
1953
2181
QUERY PLAN
1954
2182
---------------------------------------------------------------
0 commit comments