The following bug has been logged on the website:
Bug reference: 17694
Logged by: David Wheeler
Email address: david@justatheory.com
PostgreSQL version: 15.1
Operating system: macOS
Description:
The correct way to specify an absolute JSON path expression is to start with
`$.`, as in:
```
david=# select '{"foo": 1}' @? '$.foo';
?column?
----------
t
```
If, however, you omit the dot (`.`), the expression incorrectly always
evaluates to true!
```
david=# select '{"foo": 1}' @? '$foo';
?column?
----------
t
david=# select '{"foo": 1}' @? '$"foo bar"';
?column?
----------
t
david=# select '{"foo": 1}' @? '$"foo bar".bar';
?column?
----------
f
```
It looks like the text between the `$` and `.` is ignored. I don't think
this is right. Shouldn't it be a syntax error? Seems to properly complain if
using the same pattern in subpaths:
```
david=# select '{"foo": 1}' @? '$.foo"foo bar"';
ERROR: syntax error at or near """ of jsonpath input
LINE 1: select '{"foo": 1}' @? '$.foo"foo bar"';
```