From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: osaimar19@gmail.com
Subject: BUG #16636: Upper case issue in JSONB type
Date: Fri, 25 Sep 2020 13:36:52 +0000
Message-ID: <16636-32587d821269bf49@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 16636
Logged by: ChandraKumar Ovanan
Email address: osaimar19@gmail.com
PostgreSQL version: 11.0
Operating system: Windows 10
Description:
Hi All,
Below example which I was execute query in postgres.
The problem statement here, when I use upper case function by converting
JSONB object has Null value,
Then I getting below error.
Please could fix it defect or why this behavior on postures,required
clarification
Error message:
SQL Error [22P02]: ERROR: invalid input syntax for type json
Detail: Token "NULL" is invalid.
Where: JSON data, line 1: ...E": "2018-01-10", "NAME": "TEST3"}, {"DATE":
NULL...
CREATE TABLE logs(id serial, data JSONB);
INSERT INTO logs VALUES
(1,
'[{"name":"test1","date":"2020-11-11"},{"name":"test2","date":"2018-01-10"}]'),
(2,
'[{"name":"test3","date":"2020-05-18"},{"name":"test4","date":"null"}]');
SELECT * FROM logs WHERE data @> '[{"date":null}]';
SELECT * FROM logs WHERE data @> '[{"date":"2018-01-10"}]';
SELECT * FROM logs WHERE data @> '[{"date":"2018-01-11"}]';
SELECT * FROM logs WHERE data @> '[{"name":"test4"}]';
SELECT * FROM logs WHERE lower(data::text)::jsonb @>
lower('[{"date":"2018-01-10"}]')::jsonb ; --working
SELECT * FROM logs WHERE upper(data::text)::jsonb @>
upper('[{"date":"2018-01-10"}]')::jsonb ; --Not working
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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, osaimar19@gmail.com
Subject: Re: BUG #16636: Upper case issue in JSONB type
In-Reply-To: <16636-32587d821269bf49@postgresql.org>
* 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