jsonb subscript operator returns null when key is fetched from table

From: exe-dealer <exe-dealer(at)yandex(dot)ru>
To: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: jsonb subscript operator returns null when key is fetched from table
Date: 2022-12-09 20:06:51
Message-ID: 205321670615953@mail.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<div><div><div>jsonb subscript operator returns null when key is fetched from table.</div><div> </div></div><div>PostgreSQL 15.1 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit</div><div> </div><div><span style="font-family:'courier new' , monospace">WITH cte AS MATERIALIZED (SELECT 'foo' k, '{"foo":"bar"}'::jsonb j)</span></div><div><span style="font-family:'courier new' , monospace">SELECT j[k], j[k || ''] FROM cte;</span></div><div> </div><div>-- returns</div><div>-- null, "bar"</div><div> </div><div>-- expected</div><div>-- "bar", "bar"</div><div> </div></div>

Attachment Content-Type Size
unknown_filename text/html 627 bytes

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-12-10 02:13:09 Re: BUG #17710: Slow queries (100% CPU) after auto-vacuum
Previous Message PG Bug reporting form 2022-12-09 15:46:04 BUG #17710: Slow queries (100% CPU) after auto-vacuum