1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-12 21:01:52 +03:00

Built-in JSON data type.

Like the XML data type, we simply store JSON data as text, after checking
that it is valid.  More complex operations such as canonicalization and
comparison may come later, but this is enough for not.

There are a few open issues here, such as whether we should attempt to
detect UTF-8 surrogate pairs represented as \uXXXX\uYYYY, but this gets
the basic framework in place.
This commit is contained in:
Robert Haas
2012-01-31 11:48:23 -05:00
parent 4c6cedd1b0
commit 5384a73f98
11 changed files with 1059 additions and 5 deletions

24
src/include/utils/json.h Normal file
View File

@ -0,0 +1,24 @@
/*-------------------------------------------------------------------------
*
* json.h
* Declarations for JSON data type support.
*
* Portions Copyright (c) 1996-2012, 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"
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);
#endif /* XML_H */