Re: [HACKERS] SQL/JSON in PostgreSQL
От
Nikita Glukhov
Тема
Re: [HACKERS] SQL/JSON in PostgreSQL
Дата
Msg-id
a7ebb5d0-2bb2-6ff1-8d92-5dcaf35d3d94@postgrespro.ru
Ответ на
Re: [HACKERS] SQL/JSON in PostgreSQL (Pavel Stehule)
Список
Дерево обсуждения
[HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Piotr Stefaniak <email@piotr-stefaniak.me>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL David Steele <david@pgmasters.net>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Andres Freund <andres@anarazel.de>
Re: [HACKERS] SQL/JSON in PostgreSQL "Sven R. Kunze" <srkunze@mail.de>
Re: [HACKERS] SQL/JSON in PostgreSQL Nico Williams <nico@cryptonector.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Peter van Hardenberg <pvh@pvh.ca>
Re: [HACKERS] SQL/JSON in PostgreSQL "Sven R. Kunze" <srkunze@mail.de>
Re: [HACKERS] SQL/JSON in PostgreSQL Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nico Williams <nico@cryptonector.com>
Re: [HACKERS] SQL/JSON in PostgreSQL "Sven R. Kunze" <srkunze@mail.de>
Re: [HACKERS] SQL/JSON in PostgreSQL Peter van Hardenberg <pvh@pvh.ca>
Re: [HACKERS] SQL/JSON in PostgreSQL "Sven R. Kunze" <srkunze@mail.de>
Re: [HACKERS] SQL/JSON in PostgreSQL Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [HACKERS] SQL/JSON in PostgreSQL "Sven R. Kunze" <srkunze@mail.de>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Magnus Hagander <magnus@hagander.net>
Re: [HACKERS] SQL/JSON in PostgreSQL "Sven R. Kunze" <srkunze@mail.de>
Re: [HACKERS] SQL/JSON in PostgreSQL Nico Williams <nico@cryptonector.com>
Re: [HACKERS] SQL/JSON in PostgreSQL "Sven R. Kunze" <srkunze@mail.de>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Josh Berkus <josh@berkus.org>
Re: [HACKERS] SQL/JSON in PostgreSQL "Sven R. Kunze" <srkunze@mail.de>
Re: [HACKERS] SQL/JSON in PostgreSQL Magnus Hagander <magnus@hagander.net>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL David Steele <david@pgmasters.net>
Re: [HACKERS] SQL/JSON in PostgreSQL David Steele <david@pgmasters.net>
Re: [HACKERS] SQL/JSON in PostgreSQL Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Daniel Gustafsson <daniel@yesql.se>
Re: [HACKERS] SQL/JSON in PostgreSQL Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: [HACKERS] SQL/JSON in PostgreSQL Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Oleg Bartunov <obartunov@gmail.com>
Re: [HACKERS] SQL/JSON in PostgreSQL Pavel Stehule <pavel.stehule@gmail.com>
On 07.01.2018 00:33, Pavel Stehule wrote:
This is non-standard feature, but it can be easily added for compatibility with other implementations.2018-01-06 22:23 GMT+01:00 Nikita Glukhov <n.gluhov@postgrespro.ru>:".title" simply should go after the filter:On 07.01.2018 00:22, Pavel Stehule wrote:
-- not sure, if it is correctHow I can get title of book with cost 6?I am not jsonpath expert, so I can be badHiI try jsonpath on json
{
"book":
[
{
"title": "Beginning JSON",
"author": "Ben Smith",
"price": 49.99
},
{
"title": "JSON at Work",
"author": "Tom Marrs",
"price": 29.99
},
{
"title": "Learn JSON in a DAY",
"author": "Acodemy",
"price": 8.99
},
{
"title": "JSON: Questions and Answers",
"author": "George Duckett",
"price": 6.00
}
],
"price range":
{
"cheap": 10.00,
"medium": 20.00
}
}
postgres=# select j @* '$.book[*] ? (@.price==6)' from test;
┌─────────────────────────────────────────────────────┐
│ ?column? │
╞═════════════════════════════════════════════════════╡
│ {↵│
│ "title": "JSON: Questions and Answers",↵│
│ "author": "George Duckett", ↵│
│ "price": 6.00 ↵│
│ }↵│
││
└─────────────────────────────────────────────────────┘
(1 row)postgres=# select j @* '$.book[*].title ? (@.price==6)' from test;
┌──────────┐
│ ?column? │
╞══════════╡
└──────────┘
(0 rows)I found some examples, where the filter has bigger sense, but it is not supportedLINE 1: select j @* '$.book[?(@.price==6.00)].title' from test;
^
DETAIL: syntax error, unexpected '?' at or near "?"
select j @* '$.book[*] ? (@.price==6.00).title' from test;It is working, thank you.and the form "$.book[?(@.price==6.00)].title" ? I found this example in some other SQL/JSON implementations.
В списке pgsql-hackers по дате отправления