⌘+k ctrl+k
1.1.3 (stable)
Search Shortcut cmd + k | ctrl + k
Caveats

相等比较

警告 目前,JSON文件的相等性比较可能会根据上下文有所不同。在某些情况下,它基于原始文本比较,而在其他情况下,它使用逻辑内容比较。

以下查询对所有字段返回 true:

SELECT
    a != b, -- Space is part of physical JSON content. Despite equal logical content, values are treated as not equal.
    c != d, -- Same.
    c[0] = d[0], -- Equality because space was removed from physical content of fields:
    a = c[0], -- Indeed, field is equal to empty list without space...
    b != c[0], -- ... but different from empty list with space.
FROM (
    SELECT
        '[]'::JSON AS a,
        '[ ]'::JSON AS b,
        '[[]]'::JSON AS c,
        '[[ ]]'::JSON AS d
    );
(a != b) (c != d) (c[0] = d[0]) (a = c[0]) (b != c[0])
true true true true true