pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ewherrmann@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18356: Casting values from jsonb_each_text does not respect WHERE filter with sub select
Date: Wed, 21 Feb 2024 15:17:58 -0500
Message-ID: <123109.1708546678@sss.pgh.pa.us> (raw)
In-Reply-To: <18356-a811d014209fd19c@postgresql.org>
References: <18356-a811d014209fd19c@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> - Prior to v16, this statement would work for casting values of a k/v jsonb
> pair to an integer:
>                     SELECT id, mytdata.key, mytdata.value::integer
>                     FROM my_table as myt,
>                         jsonb_each_text(myt.data) as mytdata
>                     WHERE mytdata.key IN ( SELECT key from week_key_table
> )

> - Where week_key_table stores keys such as "week01", "week02", and
> "week03".
> - And where the jsonb has some keys with alphanumeric values and some keys
> with numeric values, such as: { "key_figure": "Volume", "week01": "0",
> "week02": "0", "week03": "0"}

> However as of v16, this same statement causes the error: 'invalid input
> syntax for type double precision: "Volume"'. 

Could you provide an actually self-contained example?  People
have other things to do than guess about the data and table details
needed to reproduce this.

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <123109.1708546678@sss.pgh.pa.us>
Permalink:  ../123109.1708546678@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/123109.1708546678@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, ewherrmann@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18356: Casting values from jsonb_each_text does not respect WHERE filter with sub select
  In-Reply-To: <123109.1708546678@sss.pgh.pa.us>

* 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