Re: Bypassing NULL elements in row_to_json function

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Bypassing NULL elements in row_to_json function
Date: 2016-04-09 14:29:37
Message-ID: CAOzAquJPR+F5vP9PdLr1pnA5wa8QbtaJ+2LwREFsPBeqJTMgcw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was able to try it on a test server, the combination of row_to_json() and
json_strip_nulls() worked exactly as I had hoped. Stripping nulls reduced
the JSON file by over 50%. (The data I needed to export has around 900,000
rows, so it gets quite large.)

I've got a test file I can make available to app developers.

My next task is to find out if validating and importing a JSON file into a
table is as easy as exporting a table in JSON turned out to be. Thanks for
the help.
--
Mike Nolan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-04-09 15:14:08 Re: Really unique session ID - PID + connection timestamp?
Previous Message Adrian Klaver 2016-04-09 14:05:24 Re: Really unique session ID - PID + connection timestamp?