json_query - redundant result

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Oleg Bartunov <obartunov(at)gmail(dot)com>
Subject: json_query - redundant result
Date: 2022-04-28 08:16:41
Message-ID: CAFj8pRDgxcD5imBqWODk0y_MKU=1Oek1CutTXpq1apZSBNbk5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

I am learning new JSON API, and I am not sure, how the result of JSON_QUERY
in one case is correct. So I am asking here

(2022-04-28 10:13:26) postgres=# SELECT JSON_QUERY(jsonb '[{"a":10, "b":
20}, {"a": 30, "b":100}]', '$.**.a' with wrapper);
┌──────────────────┐
│ json_query │
╞══════════════════╡
│ [10, 30, 10, 30] │
└──────────────────┘
(1 row)

Is this result correct? I am expecting just [10, 30]

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message kuroda.hayato@fujitsu.com 2022-04-28 08:34:23 RE: Multi-Master Logical Replication
Previous Message Michael Paquier 2022-04-28 06:49:42 Re: Possible corruption by CreateRestartPoint at promotion