Search Postgresql Archives

Re: jsonb_set() strictness considered harmful to data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 20, 2019 at 5:31 AM Andrew Dunstan <andrew.dunstan@xxxxxxxxxxxxxxx> 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.
 
Possibly we could even add an extra
parameter to specify what should be done.

Has appeal.

 
Should we return NULL in those cases as we do now?

Probably the same thing - though I'd accept having the input json being null result in the output json being null as well.

David J.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux