aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2024-04-24 11:31:47 +0200
committerPeter Eisentraut <peter@eisentraut.org>2024-04-24 11:37:37 +0200
commita8457887c3c15123f644a40279d24fc2e26fe3cc (patch)
tree034dfa8bd8d550251329e1d44dafdfdf8547626e
parentce1c30eceb57ccb8ede96565c252bb6f41b6d4e1 (diff)
downloadpostgresql-a8457887c3c15123f644a40279d24fc2e26fe3cc.tar.gz
postgresql-a8457887c3c15123f644a40279d24fc2e26fe3cc.zip
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
-rw-r--r--doc/src/sgml/json.sgml15
1 files changed, 7 insertions, 8 deletions
diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml
index 97677c48761..8543d5789fb 100644
--- a/doc/src/sgml/json.sgml
+++ b/doc/src/sgml/json.sgml
@@ -686,21 +686,20 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] == "qui"';
In particular, the way to write a double quote within an embedded string
literal is <literal>\"</literal>, and to write a backslash itself, you
must write <literal>\\</literal>. Other special backslash sequences
- include those recognized in JSON strings:
+ include those recognized in JavaScript strings:
<literal>\b</literal>,
<literal>\f</literal>,
<literal>\n</literal>,
<literal>\r</literal>,
<literal>\t</literal>,
<literal>\v</literal>
- for various ASCII control characters, and
- <literal>\u<replaceable>NNNN</replaceable></literal> 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,
<literal>\x<replaceable>NN</replaceable></literal> for a character code
- written with only two hex digits, and
- <literal>\u{<replaceable>N...</replaceable>}</literal> for a character
- code written with 1 to 6 hex digits.
+ written with only two hex digits,
+ <literal>\u<replaceable>NNNN</replaceable></literal> for a Unicode
+ character identified by its 4-hex-digit code point, and
+ <literal>\u{<replaceable>N...</replaceable>}</literal> for a Unicode
+ character code point written with 1 to 6 hex digits.
</para>
<para>