Re: json_strip_nulls()

2022-01-22 Thread Erwin Brandstetter
On Sat, 22 Jan 2022 at 22:00, Tom Lane wrote: > Erwin Brandstetter writes: > > On Sat, 22 Jan 2022 at 20:31, David G. Johnston < > david.g.johns...@gmail.com> > > wrote: > >> json_strip_nulls doesn't make any promise regarding its output json > other > >> than that it is valid. Since we are mun

Re: json_strip_nulls()

2022-01-22 Thread Tom Lane
Erwin Brandstetter writes: > On Sat, 22 Jan 2022 at 20:31, David G. Johnston > wrote: >> json_strip_nulls doesn't make any promise regarding its output json other >> than that it is valid. Since we are munging the json we are arguably >> within our rights to output whatever transformed version w

Re: json_strip_nulls()

2022-01-22 Thread Erwin Brandstetter
On Sat, 22 Jan 2022 at 20:31, David G. Johnston wrote: > On Sat, Jan 22, 2022 at 12:11 PM Erwin Brandstetter > wrote: > >> But the function also strips all insignificant white space: >> [...] >> This is a useful feature to trim noise from json values, but unreliable >> while undocumented. So let

Re: json_strip_nulls()

2022-01-22 Thread David G. Johnston
On Sat, Jan 22, 2022 at 12:11 PM Erwin Brandstetter wrote: > But the function also strips all insignificant white space: > > test=> SELECT json_strip_nulls(json '{"a": 1 , > test'> "foo" : "bar" > test'> }'); > json_strip_nulls > ---