mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-05 18:59:21 +02:00
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.
36 lines
1.0 KiB
C
36 lines
1.0 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* json.h
|
|
* Declarations for JSON data type support.
|
|
*
|
|
* Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/utils/json.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
|
|
#ifndef JSON_H
|
|
#define JSON_H
|
|
|
|
#include "fmgr.h"
|
|
#include "lib/stringinfo.h"
|
|
|
|
extern Datum json_in(PG_FUNCTION_ARGS);
|
|
extern Datum json_out(PG_FUNCTION_ARGS);
|
|
extern Datum json_recv(PG_FUNCTION_ARGS);
|
|
extern Datum json_send(PG_FUNCTION_ARGS);
|
|
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 */
|