diff options
author | Amit Langote | 2025-02-19 06:07:24 +0000 |
---|---|---|
committer | Amit Langote | 2025-02-19 06:07:24 +0000 |
commit | 77cdee9ea905f32c5c93d1505ec85db3ecea5dd4 (patch) | |
tree | 9c3e9213bed7404e0ece00e3dbccbd8c3af520ab /doc | |
parent | 7edd2cbc535cc093abc84ccc5764d794609e1473 (diff) |
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 <[email protected]>
Author: Robert Treat <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/sgml/func.sgml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index cb9a6e2c910..1c5e4bc5732 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -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[*]' |