BUG #18809: Inconsistent JSON behavoir - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18809: Inconsistent JSON behavoir
Date
Msg-id 18809-601694c9be8a4026@postgresql.org
Whole thread Raw
Responses Re: BUG #18809: Inconsistent JSON behavoir
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18809
Logged by:          Mark Drake
Email address:      mark.drake@golden-hind.com
PostgreSQL version: 17.0
Operating system:   Linux
Description:

broadway=# select jsonb('[2,3,1]') @> to_jsonb(1);
 ?column?
----------
 t
(1 row)


broadway=# select jsonb('[2,3,1]') @> to_jsonb(4);
 ?column?
----------
 f
(1 row)


broadway=# select jsonb('[2,3,1]') @> to_jsonb(4);
 ?column?
----------
 f
(1 row)


broadway=# select jsonb('[2,3,1]') - 1;
 ?column?
----------
 [2, 1]
(1 row)


broadway=#
broadway=# select jsonb('[2,3,1]') - to_jsonb(1);
ERROR:  operator does not exist: jsonb - jsonb
LINE 1: select jsonb('[2,3,1]') - to_jsonb(1);
                                ^
HINT:  No operator matches the given name and argument types. You might need
to add explicit type casts.
broadway=#

Given that the first statement show the array contains an element that
matches to_jsonb(1) the fourth statement should delete the third ( index 2)
item from the array, not return an argument type mismatch. This would solve
the problem of not being able to delete from a JSON integer array by value


pgsql-bugs by date:

Previous
From: Amit Langote
Date:
Subject: Re: BUG #18806: When enable_rartitionwise_join is set to ON, the database shuts down abnormally
Next
From: Ashutosh Bapat
Date:
Subject: Re: BUG #18806: When enable_rartitionwise_join is set to ON, the database shuts down abnormally