Skip to content

Commit 630ed7e

Browse files
committed
doc: Correct jsonpath string literal escapes description
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 <ewie@ewie.name> Discussion: https://www.postgresql.org/message-id/flat/1EB17DF9-2636-484B-9DD0-3CAB19C4F5C4@justatheory.com
1 parent 3ed6e16 commit 630ed7e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

doc/src/sgml/json.sgml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -794,21 +794,20 @@ UPDATE table_name SET jsonb_field[1]['a'] = '1';
794794
In particular, the way to write a double quote within an embedded string
795795
literal is <literal>\"</literal>, and to write a backslash itself, you
796796
must write <literal>\\</literal>. Other special backslash sequences
797-
include those recognized in JSON strings:
797+
include those recognized in JavaScript strings:
798798
<literal>\b</literal>,
799799
<literal>\f</literal>,
800800
<literal>\n</literal>,
801801
<literal>\r</literal>,
802802
<literal>\t</literal>,
803803
<literal>\v</literal>
804-
for various ASCII control characters, and
805-
<literal>\u<replaceable>NNNN</replaceable></literal> for a Unicode
806-
character identified by its 4-hex-digit code point. The backslash
807-
syntax also includes two cases not allowed by JSON:
804+
for various ASCII control characters,
808805
<literal>\x<replaceable>NN</replaceable></literal> for a character code
809-
written with only two hex digits, and
810-
<literal>\u{<replaceable>N...</replaceable>}</literal> for a character
811-
code written with 1 to 6 hex digits.
806+
written with only two hex digits,
807+
<literal>\u<replaceable>NNNN</replaceable></literal> for a Unicode
808+
character identified by its 4-hex-digit code point, and
809+
<literal>\u{<replaceable>N...</replaceable>}</literal> for a Unicode
810+
character code point written with 1 to 6 hex digits.
812811
</para>
813812

814813
<para>

0 commit comments

Comments
 (0)