Fix a couple of cases of JSON output.
Andrew Dunstan <andrew@dunslane.net>
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
| Path | Change | +/− |
|---|---|---|
| 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 |