Re: Ambiguity in IS JSON description and logic - Mailing list pgsql-docs

From Laurenz Albe
Subject Re: Ambiguity in IS JSON description and logic
Date
Msg-id 109c4b7c676cfde0d9c8666fa2c1f0063453df18.camel@cybertec.at
Whole thread Raw
In response to Re: Ambiguity in IS JSON description and logic  (r314tive <tanswis42@gmail.com>)
List pgsql-docs
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



pgsql-docs by date:

Previous
From: r314tive
Date:
Subject: Re: Ambiguity in IS JSON description and logic
Next
From: Peter Eisentraut
Date:
Subject: Re: Documentation improvement patch