Re: Q: Escapes in jsonpath Idents
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Erik Wienhold <ewie@ewie.name>, "David E. Wheeler" <david@justatheory.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-04-24T09:46:40Z
Lists: pgsql-hackers
On 17.03.24 20:12, Erik Wienhold wrote:
> Mentioning JSON and \v in the same sentence is wrong: JavaScript allows
> that escape in strings but JSON doesn't. I think the easiest is to just
> replace "JSON" with "JavaScript" in that sentence to make it right. The
> paragraph also already says "embedded string literals follow JavaScript/
> ECMAScript conventions", so mentioning JSON seems unnecessary to me.
>
> The last sentence also mentions backslash escapes \xNN and \u{N...} as
> deviations from JSON when in fact those are valid escape sequences from
> ECMA-262:https://262.ecma-international.org/#prod-HexEscapeSequence
> So I think it makes sense to reword the entire backslash part of the
> paragraph and remove references to JSON entirely. The attached patch
> does that and also formats the backslash escapes as a bulleted list for
> readability.
I have committed this patch, and backpatched it, as a bug fix, because
the existing description was wrong. To keep the patch minimal for
backpatching, I didn't do the conversion to a list. I'm not sure I like
that anyway, because it tends to draw more attention to that part over
the surrounding parts, which didn't seem appropriate in this case. But
anyway, if you have any more non-bug-fix editing in this area, which
would then target PG18, please send more patches.
Commits
-
doc: Correct jsonpath string literal escapes description
- a8457887c3c1 12.19 landed
- b51dff73fa73 13.15 landed
- 630ed7ec4d36 14.12 landed
- feb19bf5081f 15.7 landed
- a7ed15f3ab81 16.3 landed
- b279e37015bb 17.0 landed