
Introduction
PostgreSQL provides us with a datatype to store JSON data.
This datatype can be helpful in lots of situations giving us a way to store some dynamic data.
Further PostgreSQL provides us with two types for storing JSON data
- json
- jsonb
They both take almost identical set of inputs but the major difference is that in the efficiency.
The json
data type stores the exact copy of the input text which the processing functions must reparse
on each execution.
On the other hand jsonb
data is stored in the decompressed binary format which makes it slightly slower
to input due to the added overhead of conversion, but significantly faster to process since no reparsing is needed.