diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2013-03-10 17:35:36 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2013-03-10 17:35:36 -0400 |
commit | 38fb4d978c5bfc377ef979e2595e3472744a3b05 (patch) | |
tree | af34c36f949f83c6527921cdbac1892c22719ac5 /src/include/utils/json.h | |
parent | dd28c410f77e415ce104cb42bf52c4a5457085da (diff) |
JSON generation improvements.
This adds the following:
json_agg(anyrecord) -> json
to_json(any) -> json
hstore_to_json(hstore) -> json (also used as a cast)
hstore_to_json_loose(hstore) -> json
The last provides heuristic treatment of numbers and booleans.
Also, in json generation, if any non-builtin type has a cast to json,
that function is used instead of the type's output function.
Andrew Dunstan, reviewed by Steve Singer.
Catalog version bumped.
Diffstat (limited to 'src/include/utils/json.h')
-rw-r--r-- | src/include/utils/json.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/utils/json.h b/src/include/utils/json.h index 34f37d7b8b1..caaa769449a 100644 --- a/src/include/utils/json.h +++ b/src/include/utils/json.h @@ -25,6 +25,11 @@ extern Datum array_to_json(PG_FUNCTION_ARGS); extern Datum array_to_json_pretty(PG_FUNCTION_ARGS); extern Datum row_to_json(PG_FUNCTION_ARGS); extern Datum row_to_json_pretty(PG_FUNCTION_ARGS); +extern Datum to_json(PG_FUNCTION_ARGS); + +extern Datum json_agg_transfn(PG_FUNCTION_ARGS); +extern Datum json_agg_finalfn(PG_FUNCTION_ARGS); + extern void escape_json(StringInfo buf, const char *str); #endif /* JSON_H */ |