Updated patch: the JSON code has all been moved into core, so this
patch is now for a built-in data type. However, I factored the
general-purpose utility functions out into a different patch to be
reviewed separately, so this JSON data type patch won't work without
the utility patch at
http://archives.postgresql.org/pgsql-hackers/2010-08/msg00949.php .
I still need to improve the documentation, as it still looks like the
documentation for a module instead of a built-in data type. Also, the
code is not taking advantage of the json_type_t enum being built-in
yet; it still uses getEnumLabelOids (one of the utility functions) to
retrieve the OIDs dynamically.
Joey Adams