Thread

  1. Re: Ambiguity in IS JSON description and logic

    Laurenz Albe <laurenz.albe@cybertec.at> — 2025-11-18T16:37:21Z

    On Tue, 2025-11-18 at 16:55 +0500, r314tive wrote:
    > Based on this discussion, I’ve prepared a small documentation patch that
    > tries to clarify the behavior of the IS JSON ... UNIQUE KEYS clause.
    > 
    > The patch explains that:
    > - the WITH/WITHOUT UNIQUE KEYS clause controls an additional test on
    >   duplicate object keys,
    > - WITH UNIQUE KEYS requires that no object contained in the expression
    >   (recursively) have duplicate keys, and
    > - WITHOUT UNIQUE KEYS, which is also the default, just disables this
    >   additional test and does not require duplicates to be present.
    > 
    > Patch is attached.
    
    I don't think that the patch is really an improvement.  To me, the original
    wording contains all the important information.  The patch it somewhat
    repetetive and contains unnecessary detail.  For example, I can see from
    the syntax diagram that I can use WITHOUT UNIQUE KEYS, and I have no
    trouble guessing what that means.
    
    Perhaps it would be enough to add something like "*recursively* checks for
    duplicate keys" or "checks for duplicate keys *on any nesting level*".
    
    Yours,
    Laurenz Albe