Re: Unexpected extra row from jsonb_path_query() with a recursive path

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Jan Przemysław Wójcik <jan(dot)przemyslaw(dot)wojcik(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Subject: Re: Unexpected extra row from jsonb_path_query() with a recursive path
Date: 2019-12-10 02:38:05
Message-ID: 20191210023805.GF72921@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2019-12-10 03:13:28 Re: Warning in the RecordTransactionAbort routine during compilation with O3 flag
Previous Message Tom Lane 2019-12-09 15:19:27 Re: BUG #16157: handling of pg_malloc(0)