mirror of
https://github.com/postgres/postgres.git
synced 2025-05-21 15:54:08 +03:00
doc: Fix some issues with JSON_TABLE() exampls
1. Remove an unused PASSING variable. 2. Adjust formatting of JSON data used 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
This commit is contained in:
parent
7edd2cbc53
commit
77cdee9ea9
@ -19308,7 +19308,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',
|
||||
@ -19395,13 +19395,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[*]'
|
||||
|
Loading…
x
Reference in New Issue
Block a user