Bypassing NULL elements in row_to_json function

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Bypassing NULL elements in row_to_json function
Date: 2016-04-08 15:31:06
Message-ID: CAOzAquLGKEBDBKajAdVo7uMC0R52facO3A1f6QNn6h=mNR-6Cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm looking at the possibility of using JSON as a data exchange format
with some apps running on both PCs and Macs. .

The table I would be exporting has a lot of NULL values in it. Is
there any way to skip the NULL values in the row_to_json function and
include only the fields that are non-null?
--
Mike Nolan
nolan(at)tssi(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2016-04-08 15:44:16 recover from this error
Previous Message Karl O. Pinc 2016-04-08 15:04:33 Re: Transitioning to a SQL db