Re: ❓ JSON Path Dot Precedence

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: ❓ JSON Path Dot Precedence
Дата
Msg-id 9C7ABA9C-EEE6-4C04-8F26-5D456468DDF4@justatheory.com
обсуждение исходный текст
Ответ на Re: ❓ JSON Path Dot Precedence  ("David E. Wheeler" <david@justatheory.com>)
Список pgsql-hackers
Hi, following up on some old threads.

> On Apr 10, 2024, at 16:44, David E. Wheeler <david@justatheory.com> wrote:
>
> That makes sense, thanks. It’s just a little odd to me that the resulting path isn’t a query at all. To Erik’s point:
whatpath can `'0x2.p10` even select? 

I’m wondering whether the jsonpath parser should be updated to reject cases like this. I think it will always return no
results.AFAICT, there’s no way to navigate to an object identifier immediately after a number: 

david=# select '0x2.p10'::jsonpath;
 jsonpath
-----------
 (2)."p10"
(1 row)

david=# select jsonb_path_query(target => '[0, 1, {"p10": true}]', path => '0x2.p10');
 jsonb_path_query
------------------
(0 rows)

david=# select jsonb_path_query(target => '{"0x2": {"p10": true}}', path => '0x2.p10');
 jsonb_path_query
------------------
(0 rows)


It’s just inherently meaningless. BTW, it’s not limited to hex numbers:

david=# select '(2).p10'::jsonpath;
 jsonpath
-----------
 (2)."p10"

OTOH, maybe that’s a corner case we can live with.

Best,

David




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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: 回复: An implementation of multi-key sort
Следующее
От: Matthias van de Meent
Дата:
Сообщение: Re: Parallel CREATE INDEX for GIN indexes