v2-0001-doc-Fix-some-issues-with-JSON_TABLE-examples.patch
application/octet-stream
Filename: v2-0001-doc-Fix-some-issues-with-JSON_TABLE-examples.patch
Type: application/octet-stream
Part: 0
Patch
Format: format-patch
Series: patch v2-0001
Subject: doc: Fix some issues with JSON_TABLE() examples
| File | + | − |
|---|---|---|
| doc/src/sgml/func.sgml | 3 | 3 |
From 3b50eb9fcf5b925213b99a8b6f3e9b947ecc3103 Mon Sep 17 00:00:00 2001
From: Amit Langote <amitlan@postgresql.org>
Date: Fri, 14 Feb 2025 16:56:51 +0900
Subject: [PATCH v2] doc: Fix some issues with JSON_TABLE() examples
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1. Remove an unused PASSING variable.
2. Adjust formatting of JSON data use in an example to be valid under
strict mode
Reported-by: Miłosz Chmura <mieszko4@gmail.com>
Author: Robert Treat <rob@xzilla.net>
Discussion: https://postgr.es/m/173859550337.1071.4748984213168572913@wrigleys.postgresql.org
---
doc/src/sgml/func.sgml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 7efc81936ab..1e690b1320d 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -19470,7 +19470,7 @@ SELECT jt.* FROM
SELECT jt.* FROM
my_films,
JSON_TABLE (js, '$.favorites[*] ? (@.films[*].director == $filter)'
- PASSING 'Alfred Hitchcock' AS filter, 'Vertigo' AS filter2
+ PASSING 'Alfred Hitchcock' AS filter
COLUMNS (
id FOR ORDINALITY,
kind text PATH '$.kind',
@@ -19557,13 +19557,13 @@ SELECT jt.* FROM
<programlisting>
SELECT * FROM JSON_TABLE (
'{"favorites":
- {"movies":
+ [{"movies":
[{"name": "One", "director": "John Doe"},
{"name": "Two", "director": "Don Joe"}],
"books":
[{"name": "Mystery", "authors": [{"name": "Brown Dan"}]},
{"name": "Wonder", "authors": [{"name": "Jun Murakami"}, {"name":"Craig Doe"}]}]
-}}'::json, '$.favorites[*]'
+}]}'::json, '$.favorites[*]'
COLUMNS (
user_id FOR ORDINALITY,
NESTED '$.movies[*]'
--
2.43.0