Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-04 Thread Adrian Klaver
On 4/4/23 02:01, Erik Wienhold wrote: On 04/04/2023 03:50 CEST jian he wrote: "Returns true if any JSON value at the given path matches the predicate. Returns NULL when not a path predicate or comparing different types." in first sentence, should we add something "otherwise return false."

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-04 Thread Erik Wienhold
> On 04/04/2023 03:50 CEST jian he wrote: > > > "Returns true if any JSON value at the given path matches the predicate. > > Returns NULL when not a path predicate or comparing different types." > > in first sentence, should we add something "otherwise return false." ? I omitted the "otherwise

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread jian he
On Tue, Apr 4, 2023 at 12:22 AM Erik Wienhold wrote: > > On 03/04/2023 17:36 CEST Adrian Klaver > wrote: > > > > On 4/3/23 08:11, Erik Wienhold wrote: > > >> On 02/04/2023 17:40 CEST Adrian Klaver > wrote: > > >> > > >> That is a long way from: > > >> > > >> jsonb @@ jsonpath → boolean > > >>

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Adrian Klaver
On 4/3/23 12:00, Erik Wienhold wrote: On 03/04/2023 18:37 CEST Adrian Klaver wrote: On 4/3/23 09:21, Erik Wienhold wrote: On 03/04/2023 17:36 CEST Adrian Klaver wrote: On 4/3/23 08:11, Erik Wienhold wrote: On 02/04/2023 17:40 CEST Adrian Klaver wrote: That is a long way from: jsonb @@

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Erik Wienhold
> On 03/04/2023 18:37 CEST Adrian Klaver wrote: > > On 4/3/23 09:21, Erik Wienhold wrote: > >> On 03/04/2023 17:36 CEST Adrian Klaver wrote: > >> > >> On 4/3/23 08:11, Erik Wienhold wrote: > On 02/04/2023 17:40 CEST Adrian Klaver wrote: > > That is a long way from: > >

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Adrian Klaver
On 4/3/23 09:21, Erik Wienhold wrote: On 03/04/2023 17:36 CEST Adrian Klaver wrote: On 4/3/23 08:11, Erik Wienhold wrote: On 02/04/2023 17:40 CEST Adrian Klaver wrote: That is a long way from: jsonb @@ jsonpath → boolean Returns the result of a JSON path predicate check for the specified

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Erik Wienhold
> On 03/04/2023 17:36 CEST Adrian Klaver wrote: > > On 4/3/23 08:11, Erik Wienhold wrote: > >> On 02/04/2023 17:40 CEST Adrian Klaver wrote: > >> > >> That is a long way from: > >> > >> jsonb @@ jsonpath → boolean > >> > >> Returns the result of a JSON path predicate check for the specified JSON

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Adrian Klaver
On 4/3/23 08:11, Erik Wienhold wrote: On 02/04/2023 17:40 CEST Adrian Klaver wrote: That is a long way from: jsonb @@ jsonpath → boolean Returns the result of a JSON path predicate check for the specified JSON value. Only the first item of the result is taken into account. If the result is

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Tom Lane
Erik Wienhold writes: > What do you mean? I responded to the OP's question. It's not a suggestion > to update the docs. Obviously it's quite a mouthful and needs to be boiled > down for the docs. Any suggestions? At least for the example at hand, I think a good part of the confusion stems

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Erik Wienhold
> On 02/04/2023 17:40 CEST Adrian Klaver wrote: > > That is a long way from: > > jsonb @@ jsonpath → boolean > > Returns the result of a JSON path predicate check for the specified JSON > value. Only the first item of the result is taken into account. If the > result is not Boolean, then NULL is

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-02 Thread Adrian Klaver
On 4/2/23 06:21, Erik Wienhold wrote: On 01/04/2023 08:02 CEST jian he wrote: Hi, https://www.postgresql.org/docs/current/functions-json.html jsonb @@ jsonpath → boolean Returns the result of a JSON path predicate check for the specified JSON value. Only the first item of the result is taken

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-02 Thread Tom Lane
Erik Wienhold writes: > The result is true if any array element matches the predicate because > predicates > are evaluated on sequences. The documentation for executePredicate in > src/backend/utils/adt/jsonpath_exec.c explains it: I think the OP is correct that this is undocumented at the

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-02 Thread Erik Wienhold
> On 01/04/2023 08:02 CEST jian he wrote: > > Hi, > https://www.postgresql.org/docs/current/functions-json.html > > jsonb @@ jsonpath → boolean > > Returns the result of a JSON path predicate check for the specified JSON > > value. Only the first item of the result is taken into account. If the >

​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-01 Thread jian he
Hi, https://www.postgresql.org/docs/current/functions-json.html > jsonb @@ jsonpath → boolean > > Returns the result of a JSON path predicate check for the specified JSON > value. Only the first item of the result is taken into account. If the > result is not Boolean, then NULL is returned. > >