On 05/02/2016 04:56 AM, Shulgin, Oleksandr wrote:
On Sun, May 1, 2016 at 3:22 AM, Andrew Dunstan <and...@dunslane.net
On 04/29/2016 06:11 PM, Merlin Moncure wrote:
This is a simple matter of removing spaces in the occasional C
literal in the serialization routines and adding a json_pretty
I spent a few hours on this. See
for WIP - there are three commits. No regression tests yet for the
two new functions (json_squash and json_pretty), Otherwise fairly
complete. Removing whitespace generation was pretty simple for
both json and jsonb.
Looks good, thank you!
It would make sense IMO to rename FormatState's `indent' field as
`pretty': it's being used to add whitespace between the punctuation,
not only at start of a line. I'd also move the "if (indent)" check
out of add_indent(): just don't call it if no indent is needed.
I'll try to play with the patch to produce some regression tests for
the new functions.
It was done the way it was to be as consistent as possible with how it's
done for jsonb (c.f. jsonb.c:JsonbToCStringWorker and jsonb.c::add_indent).
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: