BUG #14354: Wrong interpretation of JSON 'null'

From: kouber(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14354: Wrong interpretation of JSON 'null'
Date: 2016-10-05 10:12:59
Message-ID: 20161005101259.27234.41202@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14354
Logged by: Kouber Saparev
Email address: kouber(at)gmail(dot)com
PostgreSQL version: 9.4.5
Operating system: Fedora
Description:

Trying to pass 'null' to jsonb_each_text() results in an ERROR, while at the
same time it is considered a valid JSON value. This behaviour seems quite
inconsistent - either such a value should be considered invalid in general,
either the function should treat it as a normal NULL instead.

db=# select 'null'::jsonb;
jsonb
-------
null
(1 row)

db=# select jsonb_each_text('null'::jsonb);
ERROR: cannot call jsonb_each_text on a non-object

db=# select jsonb_each_text(NULL);
jsonb_each_text
-----------------
(0 rows)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message mmerta 2016-10-05 14:01:02 Wrong results of function age(timestamp, timestamp)
Previous Message John R Pierce 2016-10-05 10:00:34 Re: BUG #14329: libpq doesn't send complete client certificate chain on first SSL connection