Skip to content

jsonpath: add like_regex support #143243

@normanchenn

Description

@normanchenn

Currently jsonpath does not support like_regex within predicates during evaluation. Some examples below:

norman=# SELECT jsonb_path_query('{}', 'null like_regex "^he.*$"');
 jsonb_path_query
------------------
 null
(1 row)
norman=# SELECT jsonb_path_query('{}', '"hello" like_regex "^he.*$"');
 jsonb_path_query
------------------
 true
(1 row)
norman=# SELECT jsonb_path_query('{}', '"ahello" like_regex "^he.*$"');
 jsonb_path_query
------------------
 false
(1 row)

Jira issue: CRDB-48721

Metadata

Metadata

Assignees

Labels

A-sql-jsonJSON handling in SQL.A-sql-pgcompatSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries Team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions