From: David E. Wheeler <david@justatheory.com>
To: David E. Wheeler <david@justatheory.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17694: In JSONPath expressions, characters between leading $ and dot appear to be ignored
Date: Sun, 27 Nov 2022 17:47:53 -0500
Message-ID: <8B76CFDC-830C-4DF0-9958-CAED05E40133@justatheory.com> (raw)
In-Reply-To: <1DBB0108-3DB1-43BF-BA5A-DCF64743D895@justatheory.com>
References: <17694-2f7d9576ae277d64@postgresql.org>
<CAKFQuwYTM51B6=wF6BObRBfrgCvfwKmU5qGp9jgYxwHWHiFMuQ@mail.gmail.com>
<7B406A27-7142-4F6D-976A-207B4487C7C3@justatheory.com>
<CAKFQuwa4=K=xV=M7AEOczAyWSZS96X513YBo9-7gHqsvsgcqHA@mail.gmail.com>
<9CDD0519-0ABD-4E2F-AE2D-7B03B7A60738@justatheory.com>
<1DBB0108-3DB1-43BF-BA5A-DCF64743D895@justatheory.com>
On Nov 24, 2022, at 12:55, David E. Wheeler <david@justatheory.com> wrote:
> Yeah, this doesn’t seem right, either:
>
> david=# select jsonb_path_exists('{"foo": {"bar": true}}', '$path', '{"path": "$.foo.bax"}');
> jsonb_path_exists
> —————————
> t
david=# select '{}' @? '$.emails.work == "hi@home.com"';
?column?
----------
t
Works properly with `@@`, though:
david=# select '{}' @@ '$.emails.work == "hi@home.com"';
?column?
----------
f
Have to admit I find this pretty weird. I see that the docs say that this Postgres-specific boolean predicate syntax is required for @@, but it doesn’t say it doesn’t apply to @? But the `?()` filter syntax works as expected with @?:
david=# select '{}' @? '$.emails.work ?(@ == "hi@home.com")';
?column?
----------
f
Wondering if I should avoid `@?`. Frankly I don’t understand the difference between `@@` and `@?`.
Best,
David
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: david@justatheory.com, david.g.johnston@gmail.com
Subject: Re: BUG #17694: In JSONPath expressions, characters between leading $ and dot appear to be ignored
In-Reply-To: <8B76CFDC-830C-4DF0-9958-CAED05E40133@justatheory.com>
References: <17694-2f7d9576ae277d64@postgresql.org> <CAKFQuwYTM51B6=wF6BObRBfrgCvfwKmU5qGp9jgYxwHWHiFMuQ@mail.gmail.com> <7B406A27-7142-4F6D-976A-207B4487C7C3@justatheory.com> <CAKFQuwa4=K=xV=M7AEOczAyWSZS96X513YBo9-7gHqsvsgcqHA@mail.gmail.com> <9CDD0519-0ABD-4E2F-AE2D-7B03B7A60738@justatheory.com> <1DBB0108-3DB1-43BF-BA5A-DCF64743D895@justatheory.com> <8B76CFDC-830C-4DF0-9958-CAED05E40133@justatheory.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox