proposal: ignore null fields in not relation type composite type based constructors

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема proposal: ignore null fields in not relation type composite type based constructors
Дата
Msg-id CAFj8pRA1KZt8v8Eo9r9zED25w3cfMm8n-_5+cySpPs0Xz-bYrQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: proposal: ignore null fields in not relation type composite type based constructors  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Hello

In Czech Postgres mailing list was user request for serialization to json without null values.

He needs a similar behave like XMLFOREST has - it ignores NULLs

In some situations and conversions, when your table is +/- sparse matrix, this request is valid

postgres=# select hstore(omega) from omega;
             hstore             
─────────────────────────────────
 "a"=>"10", "b"=>"20", "c"=>NULL
 "a"=>NULL, "b"=>"20", "c"=>"30"
(2 rows)

Proposed function

postgres=# select hstore(omega, ignore_nulls := true) from omega;
             hstore             
─────────────────────────────────
 "a"=>"10", "b"=>"20"
 "b"=>"20", "c"=>"30"
(2 rows)

What do you thinking about this proposal?

Regards

Pavel

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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Sending out a request for more buildfarm animals?
Следующее
От: Fabien COELHO
Дата:
Сообщение: pg9.4b1: unhelpful error message when creating a collation