inconsistent jsonb 'null' conversions - Mailing list pgsql-hackers

From Pavel Stehule
Subject inconsistent jsonb 'null' conversions
Date
Msg-id CAFj8pRCX_a0wo5AD5ZvTJ=x-GnxVP7PoneJM-QyQcptM4TLpMA@mail.gmail.com
Whole thread
Responses Re: inconsistent jsonb 'null' conversions
List pgsql-hackers
Hi

I found inconsistency in casting the value "null" of jsonb type to scalar types.

(2026-07-05 14:54:08) postgres=# select 'null'::jsonb::int is null;
┌──────────┐
│ ?column? │
╞══════════╡
│ t        │
└──────────┘
(1 row)

(2026-07-05 14:56:26) postgres=# select 'null'::jsonb::varchar is null;
┌──────────┐
│ ?column? │
╞══════════╡
│ f        │
└──────────┘
(1 row)

Is it expected behaviour? 

Regards

Pavel

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: (SQL/PGQ) Clean up orphaned properties when dropping a label
Next
From: Dongpo Liu
Date:
Subject: [PATCH] Remove unused include from analyze.c