agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Thomas Kellerer <shammat@gmx.net>
To: pgsql-sql@lists.postgresql.org
Subject: JSON path query returns duplicate values
Date: Mon, 21 Dec 2020 10:43:18 +0100
Message-ID: <1bbaff39-e7be-c579-779f-4ead5b47ac57@gmx.net> (raw)
Hello,
I wonder why this query
select jsonb_path_query_array(col, '$.**.itemName')
from (
values ('{"items": [{"itemName": "a", "items": [{"itemName": "b"}]}]}'::jsonb)
) as t(col)
returns each itemName twice: ["a", "a", "b", "b"]
I would have expected: ["a", "b"]
Thomas
view thread (2+ messages) latest in thread
Message-ID: <1bbaff39-e7be-c579-779f-4ead5b47ac57@gmx.net>
Permalink: ../1bbaff39-e7be-c579-779f-4ead5b47ac57@gmx.net/
Also on: postgresql.org/message-id/1bbaff39-e7be-c579-779f-4ead5b47ac57@gmx.net
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-sql@postgresql.org
Cc: shammat@gmx.net, pgsql-sql@lists.postgresql.org
Subject: Re: JSON path query returns duplicate values
In-Reply-To: <1bbaff39-e7be-c579-779f-4ead5b47ac57@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox