During my attendance at the SURGE conference last week, some people asked me about the new JSON support in Postgres 9.2. As I started to explain it, I realized that the description was quite complicated, and I agreed to post a blog entry about it — so here it is. (Linux Weekly News also has an article that summarizes the 9.2 JSON features.)
The JSON features added in Postgres 9.2 were not major:
- Create a JSON data type that stores JSON as a text string, and checks that the string is valid JSON.
- Add two support functions that allow arrays and row values to be converted to JSON (examples).
Seems pretty simple, and not a great leap forward. However, as with many things in Postgres, it is the coupling of these features with Postgres extensions and externally-developed features that really makes a must-have feature-set.