From 5384a73f98d9829725186a7b65bf4f8adb3cfaf1 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 31 Jan 2012 11:48:23 -0500 Subject: 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. --- src/include/utils/json.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/include/utils/json.h (limited to 'src/include/utils/json.h') diff --git a/src/include/utils/json.h b/src/include/utils/json.h new file mode 100644 index 00000000000..ee87fd61d7c --- /dev/null +++ b/src/include/utils/json.h @@ -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 */ -- cgit v1.2.3