JSON
Explore the JSON and JSONB data types in PostgreSQL, their processing functions, and indexing capabilities. Understand when to use each type and how to apply JSONB for flexible yet efficient data modeling and querying in your database applications.
We'll cover the following...
PostgreSQL has built-in support for JSON with a great range of processing functions, operators, and complete indexing support. The documentation covers all the details in the chapters entitled JSON Types and JSON Functions and Operators.
PostgreSQL implemented a very simple JSON data type back in the 9.2 release. At that time, the community pushed for providing a solution for JSON users, in contrast to the usual careful pace, though still speedy. The JSON data type is actually text under the hood, with a verification that the format is valid JSON input, much like XML.
Later, the community realized that the amount of JSON processing and advanced searching required in PostgreSQL would not be easy or reasonable to implement over a text data type and implemented a binary version of the json data type, this time with a full set of operators and functions to work with.
The json vs. jsonb data types
There are some incompatibilities between the text-based json ...