Обсуждение: BUG #17472: Jsonb[] operations not working

Поиск
Список
Период
Сортировка

BUG #17472: Jsonb[] operations not working

От
PG Bug reporting form
Дата:
The following bug has been logged on the website:

Bug reference:      17472
Logged by:          Akshay Agarwal
Email address:      agarwal3akshay@gmail.com
PostgreSQL version: 14.2
Operating system:   Windows
Description:

The jsonb[] type of columns are not supporting any kind of deletion
operations. 
Since jsonb supports array of json objects, why jsonb[] was created? is
there any difference in the performance of the same?


Re: BUG #17472: Jsonb[] operations not working

От
Pavel Stehule
Дата:
Hi

pá 29. 4. 2022 v 11:03 odesílatel PG Bug reporting form <noreply@postgresql.org> napsal:
The following bug has been logged on the website:

Bug reference:      17472
Logged by:          Akshay Agarwal
Email address:      agarwal3akshay@gmail.com
PostgreSQL version: 14.2
Operating system:   Windows
Description:       

The jsonb[] type of columns are not supporting any kind of deletion
operations.
Since jsonb supports array of json objects, why jsonb[] was created? is
there any difference in the performance of the same?

This is not a bug. Arrays are supported for almost all types in Postgres. It is a generic feature. Just json can hold arrays too, and from PostgreSQL 14 Postgres allows to use similar interface.

If jsonb arrays are faster than Postgres arrays? It depends on the task and environment. The update of a jsonb array can have the same speed as an update of a generic array in SQL, but generic arrays have special support in PL/pgSQL, and there can be significant differences in performance.

Regards

Pavel