JSON data types for PostgreSQL

PostgreSQL supports two JSON data types, mainly JSON and JSONB, both of which are implementations of RFC 7159. Both types can be used to enforce JSON rules. Both types are almost identical. However, JSONB is more efficient, as it stores JSON documents in a binary format and also supports indexes.

When using JSON, it is preferable to have UTF8 as the database encoding to ensure that the JSON type conforms to RFC 7159 standards. On one hand, when storing data as a JSON document, the JSON object is stored in a textual format. On the other hand, when storing a JSON object as JSONB, the JSON primitive data types, mainly string, Boolean, and number, will be mapped to text, Boolean, and numeric respectively.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset