Re: jsonb_set() strictness considered harmful to data

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: jsonb_set() strictness considered harmful to data
Дата
Msg-id CAKFQuwYp1b4jU294Q1tRbib3Ei9WRYBiKvGQ+ySnspSJkgdZhw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: jsonb_set() strictness considered harmful to data  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Список pgsql-general
On Sun, Oct 20, 2019 at 3:51 PM Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote:
I'm not arguing against the idea of improving the situation. But I am
arguing against a minimal fix that will not provide much of value to a
careful app developer. i.e. I want to do more to support app devs.
Ideally they would not need to use wrapper functions. There will be
plenty of situations where it is mighty inconvenient to catch an
exception thrown by jsonb_set(). And catching exceptions can be
expensive. You want to avoid that if possible in your
performance-critical plpgsql code.

As there is pretty much nothing that can be done at runtime if this exception is raised actually "catching" it anywhere deeper than near the top of the application code is largely pointless.  Its more like a NullPointerException in Java - if the application raises it there should be a last line of defense error handler that basically says "you developer made a mistake somewhere and needs to fix it - tell them this happened".

Performance critical subsections (and pretty much the whole) of the application can just raise the error to the caller using normal mechanisms for "SQLException" propogation.

David J.

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

Предыдущее
От: Horacio Miranda
Дата:
Сообщение: Re: Postgres Point in time Recovery (PITR),
Следующее
От: Steven Pousty
Дата:
Сообщение: Re: jsonb_set() strictness considered harmful to data