Re: jsonb_set() strictness considered harmful to data

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: jsonb_set() strictness considered harmful to data
Дата
Msg-id 5db07acf-bc75-edf8-60af-905c0adadb68@2ndQuadrant.com
обсуждение исходный текст
Ответ на Re: jsonb_set() strictness considered harmful to data  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: jsonb_set() strictness considered harmful to data  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Re: jsonb_set() strictness considered harmful to data  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Re: jsonb_set() strictness considered harmful to data  (Steven Pousty <steve.pousty@gmail.com>)
Re: jsonb_set() strictness considered harmful to data  (Steven Pousty <steve.pousty@gmail.com>)
Список pgsql-general
On 10/20/19 1:14 PM, David G. Johnston wrote:
> On Sun, Oct 20, 2019 at 5:31 AM Andrew Dunstan
> <andrew.dunstan@2ndquadrant.com
> <mailto:andrew.dunstan@2ndquadrant.com>> wrote:
>
>     And yet another is to
>     raise an exception, which is easy to write but really punts the issue
>     back to the application programmer who will have to decide how to
>     ensure
>     they never pass in a NULL parameter.
>
>
> That's kinda the point - if they never pass NULL they won't encounter
> any problems but as soon as the data and their application don't see
> eye-to-eye the application developer has to decide what they want to
> do about it.  We are in no position to decide for them and making it
> obvious they have a decision to make and implement here doesn't seem
> like a improper position to take.


The app dev can avoid this problem today by making sure they don't pass
a NULL as the value. Or they can use a wrapper function which does that
for them. So frankly this doesn't seem like much of an advance. And, as
has been noted, it's not consistent with what either MySQL or MSSQL do.
In general I'm not that keen on raising an exception for cases like this.


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Too many SET TimeZone and Application_name queries
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: jsonb_set() strictness considered harmful to data