doc: Correct jsonpath string literal escapes description
authorPeter Eisentraut
Wed, 24 Apr 2024 09:31:47 +0000 (11:31 +0200)
committerPeter Eisentraut
Wed, 24 Apr 2024 09:35:10 +0000 (11:35 +0200)
The paragraph describing the JavaScript string literals allowed in
jsonpath expressions unnecessarily mentions JSON by erroneously
listing \v as allowed by JSON and mentioning the \xNN and \u{N...}
backslash escapes as deviations from JSON when in fact both are
accepted by ECMAScript/JavaScript.  Fix this by only referring to
JavaScript.

Author: Erik Wienhold 
Discussion: https://www.postgresql.org/message-id/flat/1EB17DF9-2636-484B-9DD0-3CAB19C4F5C4@justatheory.com

doc/src/sgml/json.sgml

index f51254490c701d9bdde806046f97be3341dba02c..3836bf5acf3f41364783c23fc9c7a916ffbf900b 100644 (file)
@@ -803,21 +803,20 @@ UPDATE table_name SET jsonb_field[1]['a'] = '1';
    In particular, the way to write a double quote within an embedded string
    literal is \", and to write a backslash itself, you
    must write \\.  Other special backslash sequences
-   include those recognized in JSON strings:
+   include those recognized in JavaScript strings:
    \b,
    \f,
    \n,
    \r,
    \t,
    \v
-   for various ASCII control characters, and
-   \uNNNN for a Unicode
-   character identified by its 4-hex-digit code point.  The backslash
-   syntax also includes two cases not allowed by JSON:
+   for various ASCII control characters,
    \xNN for a character code
-   written with only two hex digits, and
-   \u{N...} for a character
-   code written with 1 to 6 hex digits.
+   written with only two hex digits,
+   \uNNNN for a Unicode
+   character identified by its 4-hex-digit code point, and
+   \u{N...} for a Unicode
+   character code point written with 1 to 6 hex digits.