Re: strip nulls functions for json and jsonb

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: strip nulls functions for json and jsonb
Дата
Msg-id 544D6025.4050001@dunslane.net
обсуждение исходный текст
Ответ на Re: strip nulls functions for json and jsonb  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: strip nulls functions for json and jsonb
Список pgsql-hackers
On 10/26/2014 04:22 PM, Pavel Stehule wrote:
>
>
> 2014-10-26 21:18 GMT+01:00 Andrew Dunstan <andrew@dunslane.net
> <mailto:andrew@dunslane.net>>:
>
>
>     On 10/26/2014 04:14 PM, Thom Brown wrote:
>
>         On 26 October 2014 20:07, Andrew Dunstan <andrew@dunslane.net
>         <mailto:andrew@dunslane.net> <mailto:andrew@dunslane.net
>         <mailto:andrew@dunslane.net>>> wrote:
>
>
>             On 10/26/2014 03:50 PM, Pavel Stehule wrote:
>
>                 Hi
>
>                 I have a question,
>
>                 what is expected result of null strip of
>
>                 {"a": {"b": null, "c", null"} }
>
>                 ?
>
>
>
>             Please remember not to top-post.
>
>             The above is not legal json, so the answer would be an error.
>
>
>         I believe Pavel means:
>
>         {"a": {"b": null, "c": null} }
>
>
>     This is the expected result:
>
>        andrew=# select json_strip_nulls('{"a": {"b": null, "c": null} }');
>          json_strip_nulls
>        ------------------
>          {"a":{}}
>        (1 row)
>
>
>     It is NOT expected that we replace an empty object with NULL (and
>     then strip it if it's a field value of an outer level object).
>
>
> ok,
>
> This case should be in regress test probably
>
>

Patch attached.

cheers

andrew

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] ltree::text not immutable?
Следующее
От: Tomas Vondra
Дата:
Сообщение: proposal: CREATE DATABASE vs. (partial) CHECKPOINT