Fix a couple of cases of JSON output.

Andrew Dunstan <andrew@dunslane.net>

Commit: 83fcaffea2b55152e45fdcaf3fdaf4c0c89f65ce
Author: Andrew Dunstan <andrew@dunslane.net>
Date: 2012-02-20T20:01:03Z
Releases: 9.2.0
Fix a couple of cases of JSON output.

First, as noted by Itagaki Takahiro, a datum of type JSON doesn't
need to be escaped. Second, ensure that numeric output not in
the form of a legal JSON number is quoted and escaped.

Files

PathChange+/−
src/backend/utils/adt/json.c modified +21 −4
src/test/regress/expected/json.out modified +30 −0
src/test/regress/sql/json.sql modified +15 −0