Fix overly strict Assert in jsonpath code

David Rowley <drowley@postgresql.org>

Commit: 74a5bf1b676f75f67f63e57db7e97edd8a1e923f
Author: David Rowley <drowley@postgresql.org>
Date: 2023-08-01T13:41:55Z
Releases: 13.12
Fix overly strict Assert in jsonpath code

This was failing for queries which try to get the .type() of a
jpiLikeRegex.  For example:

select jsonb_path_query('["string", "string"]',
                        '($[0] like_regex ".{7}").type()');

Reported-by: Alexander Kozhemyakin
Bug: #18035
Discussion: https://postgr.es/m/18035-64af5cdcb5adf2a9@postgresql.org
Backpatch-through: 12, where SQL/JSON path was added.

Files

PathChange+/−
src/backend/utils/adt/jsonpath.c modified +2 −1

Discussion