generating json without nulls

Поиск
Список
Период
Сортировка
От Tim Dudgeon
Тема generating json without nulls
Дата
Msg-id 554B44EA.4070803@gmail.com
обсуждение исходный текст
Ответы Re: generating json without nulls  (Andreas Joseph Krogh <andreas@visena.com>)
Список pgsql-sql
Hi All!
I'm using the postgres json functions to generate json for values in a 
table.
Something like this:

SELECT row_to_json(a_table) FROM a_table

But my data has lots of null values and that results in json attributes 
like this:

"colname":null

I want to exclude those values from the json and only include non-null 
values.
Any idea how to best go about this?

Tim



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

Предыдущее
От: Steve Midgley
Дата:
Сообщение: Re: [GENERAL] documenting tables version control
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: generating json without nulls