Re: BUG #17694: In JSONPath expressions, characters between leading $ and dot appear to be ignored

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: BUG #17694: In JSONPath expressions, characters between leading $ and dot appear to be ignored
Дата
Msg-id 8B76CFDC-830C-4DF0-9958-CAED05E40133@justatheory.com
обсуждение исходный текст
Ответ на Re: BUG #17694: In JSONPath expressions, characters between leading $ and dot appear to be ignored  ("David E. Wheeler" <david@justatheory.com>)
Список pgsql-bugs
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
requiredfor @@, 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


Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "houzj.fnst@fujitsu.com"
Дата:
Сообщение: RE: Incorrect messages emitted from pgoutput when using column lists
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: BUG #17695: Failed Assert in logical replication snapbuild.