diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2014-03-23 16:40:19 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2014-03-23 16:40:19 -0400 |
commit | d9134d0a355cfa447adc80db4505d5931084278a (patch) | |
tree | cefe155d0f0f71b9279444a86eab4b1b1facafdb /src/include/utils/json.h | |
parent | b2b2491b06074e68fc7c96148cb0fdf0c8eb0469 (diff) | |
download | postgresql-d9134d0a355cfa447adc80db4505d5931084278a.tar.gz postgresql-d9134d0a355cfa447adc80db4505d5931084278a.zip |
Introduce jsonb, a structured format for storing json.
The new format accepts exactly the same data as the json type. However, it is
stored in a format that does not require reparsing the orgiginal text in order
to process it, making it much more suitable for indexing and other operations.
Insignificant whitespace is discarded, and the order of object keys is not
preserved. Neither are duplicate object keys kept - the later value for a given
key is the only one stored.
The new type has all the functions and operators that the json type has,
with the exception of the json generation functions (to_json, json_agg etc.)
and with identical semantics. In addition, there are operator classes for
hash and btree indexing, and two classes for GIN indexing, that have no
equivalent in the json type.
This feature grew out of previous work by Oleg Bartunov and Teodor Sigaev, which
was intended to provide similar facilities to a nested hstore type, but which
in the end proved to have some significant compatibility issues.
Authors: Oleg Bartunov, Teodor Sigaev, Peter Geoghegan and Andrew Dunstan.
Review: Andres Freund
Diffstat (limited to 'src/include/utils/json.h')
-rw-r--r-- | src/include/utils/json.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/utils/json.h b/src/include/utils/json.h index baf751e9991..b5e947bd7af 100644 --- a/src/include/utils/json.h +++ b/src/include/utils/json.h @@ -64,4 +64,19 @@ extern Datum json_populate_recordset(PG_FUNCTION_ARGS); extern Datum json_to_record(PG_FUNCTION_ARGS); extern Datum json_to_recordset(PG_FUNCTION_ARGS); +extern Datum jsonb_object_field(PG_FUNCTION_ARGS); +extern Datum jsonb_object_field_text(PG_FUNCTION_ARGS); +extern Datum jsonb_array_element(PG_FUNCTION_ARGS); +extern Datum jsonb_array_element_text(PG_FUNCTION_ARGS); +extern Datum jsonb_extract_path(PG_FUNCTION_ARGS); +extern Datum jsonb_extract_path_text(PG_FUNCTION_ARGS); +extern Datum jsonb_object_keys(PG_FUNCTION_ARGS); +extern Datum jsonb_array_length(PG_FUNCTION_ARGS); +extern Datum jsonb_each(PG_FUNCTION_ARGS); +extern Datum jsonb_each_text(PG_FUNCTION_ARGS); +extern Datum jsonb_array_elements_text(PG_FUNCTION_ARGS); +extern Datum jsonb_array_elements(PG_FUNCTION_ARGS); +extern Datum jsonb_populate_record(PG_FUNCTION_ARGS); +extern Datum jsonb_populate_recordset(PG_FUNCTION_ARGS); + #endif /* JSON_H */ |