Re: BUG #17660: JSONPATH issue using like_regex followed by the && operator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shahar Belizon <shahar(at)cybear(dot)co>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17660: JSONPATH issue using like_regex followed by the && operator
Date: 2022-10-23 15:31:45
Message-ID: 3541494.1666539105@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Shahar Belizon <shahar(at)cybear(dot)co> writes:
> Well, I see what you are saying, but still, when checking the result of *SELECT
> 'a' ~ '\$$'* I'm getting a *FALSE, *so I expect the JSONPATH parser to work
> the same way.

I don't think you did grasp the point. There's an additional level of
literal-parsing and backslash-stripping involved in the jsonpath case,
because the jsonpath path string contains an embedded string literal,
which has to have some kind of escaping behavior. Otherwise, how could
you search for a pattern that includes a double-quote?

The underlying regex behavior is the same either way; it's the surface
syntax that's different because of the extra parsing layer.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2022-10-24 17:04:24 BUG #17662: Error on UPDATE with ()
Previous Message Shahar Belizon 2022-10-23 07:56:14 Re: BUG #17660: JSONPATH issue using like_regex followed by the && operator