Re: jsonb_set() strictness considered harmful to data

Поиск
Список
Период
Сортировка
От John W Higgins
Тема Re: jsonb_set() strictness considered harmful to data
Дата
Msg-id CAPhAwGwUH+uaC801Zw9_LEKU-djb2tTjM1SmCZ4+0rrj48c1gQ@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers

You're not following because you don't want to follow.


I think that anyone with a "commit bit" on this project that tolerates that sentence is a much better human being than I ever will be.

I may be the dumbest person on this list by many measures - but isn't there standard options that are supposed to be the first line of defense here? Why do I need a function to ensure I don't remove data by passing a NULL value to an update?

Why would any of these standard statements not solve this issue?

update users set info=jsonb_set(info, '{bar}', info->'foo')
where info->'foo' is not null

update users set info=jsonb_set(info, '{bar}', info->'foo')
where jsonb_set(info, '{bar}', info->'foo') is not null

update users set info=coalesce(jsonb_set(info, '{bar}', info->'foo'), info)

I can totally respect the person that slams into this wall the first time and is REALLY upset about it - but by their own admission this has occurred multiple times in this project and they continue to not take standard precautions.

Again, I applaud the patience of many people on this list. You deserve much more respect than you are being shown here right now.

John W Higgins

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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: pause recovery if pitr target not reached
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Clean up MinGW def file generation