Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a845788

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 ce1c30e commit a845788

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
@@ -686,21 +686,20 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] == "qui"';
686686
In particular, the way to write a double quote within an embedded string
687687
literal is <literal>\"</literal>, and to write a backslash itself, you
688688
must write <literal>\\</literal>. Other special backslash sequences
689-
include those recognized in JSON strings:
689+
include those recognized in JavaScript strings:
690690
<literal>\b</literal>,
691691
<literal>\f</literal>,
692692
<literal>\n</literal>,
693693
<literal>\r</literal>,
694694
<literal>\t</literal>,
695695
<literal>\v</literal>
696-
for various ASCII control characters, and
697-
<literal>\u<replaceable>NNNN</replaceable></literal> for a Unicode
698-
character identified by its 4-hex-digit code point. The backslash
699-
syntax also includes two cases not allowed by JSON:
696+
for various ASCII control characters,
700697
<literal>\x<replaceable>NN</replaceable></literal> for a character code
701-
written with only two hex digits, and
702-
<literal>\u{<replaceable>N...</replaceable>}</literal> for a character
703-
code written with 1 to 6 hex digits.
698+
written with only two hex digits,
699+
<literal>\u<replaceable>NNNN</replaceable></literal> for a Unicode
700+
character identified by its 4-hex-digit code point, and
701+
<literal>\u{<replaceable>N...</replaceable>}</literal> for a Unicode
702+
character code point written with 1 to 6 hex digits.
704703
</para>
705704

706705
<para>

0 commit comments

Comments
 (0)