pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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



view thread (3+ messages)  latest in thread

Message-ID: <16828-2b0229babfad2d8c@postgresql.org>
Permalink:  ../16828-2b0229babfad2d8c@postgresql.org/
Also on:    postgresql.org/message-id/16828-2b0229babfad2d8c@postgresql.org

 · 

reply

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