pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: exe-dealer <exe-dealer@yandex.ru>
To: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: jsonb subscript operator returns null when key is fetched from table
Date: Sat, 10 Dec 2022 02:06:51 +0600
Message-ID: <205321670615953@mail.yandex.ru> (raw)

<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>





view thread (3+ messages)  latest in thread

Message-ID: <205321670615953@mail.yandex.ru>
Permalink:  ../205321670615953@mail.yandex.ru/
Also on:    postgresql.org/message-id/205321670615953@mail.yandex.ru

 · 

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: exe-dealer@yandex.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: jsonb subscript operator returns null when key is fetched from table
  In-Reply-To: <205321670615953@mail.yandex.ru>

* 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