From: Michael Paquier <michael@paquier.xyz>
To: Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org, Nikita Glukhov <n.gluhov@postgrespro.ru>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Subject: Re: Unexpected extra row from jsonb_path_query() with a recursive path
Date: Tue, 10 Dec 2019 11:38:05 +0900
Message-ID: <20191210023805.GF72921@paquier.xyz> (raw)
In-Reply-To: <CA+YsLFqhW=13X3GHdEdy8DR8M6vqLU_fqW7DC1UPhcQb_wsKUA@mail.gmail.com>
References: <CA+YsLFo6=voUdskxNcnJdqN4Z+Kck-5t0MxcJNtecNZ5Sws9YA@mail.gmail.com>
<20191209072856.GA71819@paquier.xyz>
<CA+YsLFqhW=13X3GHdEdy8DR8M6vqLU_fqW7DC1UPhcQb_wsKUA@mail.gmail.com>
On Mon, Dec 09, 2019 at 09:37:23AM +0100, Jan Przemysław Wójcik wrote:
> Yes, there is the only object with the attribute 'key' and its value
> should be returned. Note, that a non-recursive path on the same JSON
> correctly returns a single row:
>
> select jsonb_path_query('{"data": [{"key": "value"}]}', '$.*.key')
>
> jsonb_path_query
> ------------------
> "value"
> (1 row)
Yeah, that result is right. Something looks wrong regarding the
lookup of an array's elements when doing a recursion. Let's wait a
bit to see if Nikita or Alexander have anything to share as they
implemented the feature. If not, I'll try to take a closer look at
this issue.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, jan.przemyslaw.wojcik@gmail.com, n.gluhov@postgrespro.ru, a.korotkov@postgrespro.ru
Subject: Re: Unexpected extra row from jsonb_path_query() with a recursive path
In-Reply-To: <20191210023805.GF72921@paquier.xyz>
References: <CA+YsLFo6=voUdskxNcnJdqN4Z+Kck-5t0MxcJNtecNZ5Sws9YA@mail.gmail.com> <20191209072856.GA71819@paquier.xyz> <CA+YsLFqhW=13X3GHdEdy8DR8M6vqLU_fqW7DC1UPhcQb_wsKUA@mail.gmail.com> <20191210023805.GF72921@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox