From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: shammat@gmx.net
Subject: BUG #16828: duplicate results when using ** recursive expression in JSON path
Date: Sun, 17 Jan 2021 10:34:50 +0000
Message-ID: <16828-2b0229babfad2d8c@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 16828
Logged by: Thomas Kellerer
Email address: shammat@gmx.net
PostgreSQL version: 13.1
Operating system: Windows 10, CentOS 8
Description:
The following query
select jsonb_path_query_array(col, '$.**.itemName')
from (
values ('{"items": [{"itemName": "a", "items": [{"itemName":
"b"}]}]}'::jsonb)
) as t(col)
returns ["a", "a", "b", "b"] but should return only ["a", "b"] as each value
only appears once in the JSON value.
This also happens on Postgres 12.x
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, shammat@gmx.net
Subject: Re: BUG #16828: duplicate results when using ** recursive expression in JSON path
In-Reply-To: <16828-2b0229babfad2d8c@postgresql.org>
* 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