Re: jsonb_set() strictness considered harmful to data

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: jsonb_set() strictness considered harmful to data
Дата
Msg-id CAFj8pRCKv50=DYzhPAbEiqrt3cnXRg9HccFdtxmghJUMyQPs0g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: jsonb_set() strictness considered harmful to data  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Ответы Re: jsonb_set() strictness considered harmful to data
Re: jsonb_set() strictness considered harmful to data
Список pgsql-general
Hi



For release 13+, I have given some more thought to what should be done.
I think the bar for altering the behaviour of a function should be
rather higher than we have in the present case, and the longer the
function has been sanctioned by time the higher the bar should be.
However, I think there is a case to be made for providing a non-strict
jsonb_set type function. To advance th4e discussion, attached is a POC
patch that does that. This can also be done as an extension, meaning
that users of back branches could deploy it immediately. I've tested
this against release 12, but I think it could go probably all the way
back to 9.5. The new function is named jsonb_ set_lax, but I'm open to
bikeshedding.


I am sending a review of this patch

1. this patch does what was proposed and it is based on discussion.

2. there are not any problem with patching or compilation, all regress tests passed.

4. code looks well and it is well commented.

5. the patch has enough regress tests

My notes:

a) missing documentation

b) error message is not finalized

+       ereport(ERROR,
+               (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+                errmsg("null jsonb value")));

Any other looks well, and this function can be very handy.

Regards

Pavel



В списке pgsql-general по дате отправления:

Предыдущее
От: a venkatesh
Дата:
Сообщение: pgpool High Availability Issue
Следующее
От: Tom Lane
Дата:
Сообщение: Re: here does postgres take its timezone information from?