UPDATE group_settings SET group_recepients = array_remove(group_recepients, item_to_remove)
FROM (
SELECT arr.item_object as item_to_remove
FROM group_settings,
jsonb_array_elements(group_recepients) WITH ordinality arr(item_object, position)
WHERE customer_group_id is NULL AND arr.position=1
)
WHERE customer_group_id IS NULL AND user_id = '...';
ERROR: unknown signature: array_remove(jsonb, jsonb) (desired jsonb)
postgres=# select '{"email": "a@example.com", "telegram_token": "", "telegram_user_id":""}'::jsonb - 'email';
?column?
------------------------------------------------
{"telegram_token": "", "telegram_user_id": ""}
(1 row)