BUG #16828: duplicate results when using ** recursive expression in JSON path

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: shammat(at)gmx(dot)net
Subject: BUG #16828: duplicate results when using ** recursive expression in JSON path
Date: 2021-01-17 10:34:50
Message-ID: 16828-2b0229babfad2d8c@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16828
Logged by: Thomas Kellerer
Email address: shammat(at)gmx(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message robionekenobi 2021-01-17 18:22:00 RE: BUG #16825: When building on Windows, cl /? retrun 'x64' not AMD64 and the build does not create x64 environment
Previous Message robionekenobi 2021-01-17 08:31:16 RE: BUG #16825: When building on Windows, cl /? retrun 'x64' not AMD64 and the build does not create x64 environment