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: array_to_string and string_to_array

2022-01-22 Thread Tom Lane
PG Doc comments form writes: > I suggest it would be wise to extend the definition of array_to_string > (Table 9.52) by linking to string_to_array (Table 9.10). > It would also be wise to add a backlink in the definition of string_to_array > as well. Good idea, done. rega

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 > ---

json_strip_nulls()

2022-01-22 Thread Erwin Brandstetter
The manual says this about json_strip_nulls()[1]: > Deletes all object fields that have null values from the given JSON value, recursively. Null values that are not object fields are untouched. [1] https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING-TABLE But th

array_to_string and string_to_array

2022-01-22 Thread PG Doc comments form
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/14/functions-array.html Description: Hi, I suggest it would be wise to extend the definition of array_to_string (Table 9.52) by linking to string_to_array (Table 9.10). It would also be wise