Re: Bug in jsonb_path_exists (maybe _match) one-element scalar/variable jsonpath handling
Alexander Korotkov <aekorotkov@gmail.com>
From: Alexander Korotkov <aekorotkov@gmail.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>,
Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Bug List <pgsql-bugs@lists.postgresql.org>
Date: 2022-12-05T23:57:49Z
Lists: pgsql-bugs
Attachments
- 0001-Teach-jsonpath-to-handle-missing-variables-v2.patch (application/octet-stream) patch v2-0001
On Fri, Dec 2, 2022 at 3:18 PM Alexander Korotkov <aekorotkov@gmail.com> wrote:
> Draft patch fixing the issue is attached. Let me know what you think
> about this.
Revised patch is attached, wrong pfree() is fixed. I was intended to
backpatch it. But the behavior change makes me uneasy.
select * from jsonb_path_query('{"a": 10}', '$ ? (@.a < $value)');
Currently, this query generates an error because of missing "value"
variable. The patch suppress this error. I'm not sure this error
should be suppressed. Especially, I'm sure this should be
backpatched.
Should we fix only existence checking behaviour and let other cases
throw an error? Thoughts?
------
Regards,
Alexander Korotkov
Commits
-
Fix jsonpath existense checking of missing variables
- 9e24e4781750 12.14 landed
- 2ff3ac3b5f52 13.10 landed
- 0d9221f1d251 14.7 landed
- 4dc3f94fae3d 15.2 landed
- 3161ae86ce3c 16.0 landed
-
Harmonize more parameter names in bulk.
- a601366a460f 16.0 cited