prefer-jsonb
JSON column type or table-DDL cast — use JSONB.
Why
JSONB supports indexing and containment operators and avoids reparsing the stored document on every read.
Fix
Declare JSONB columns and use jsonb casts for JSON document values.
Examples
ALTER TABLE documentALTER COLUMN metadata TYPE json USING metadata::json;ALTER TABLE documentALTER COLUMN metadata TYPE jsonb USING metadata::jsonb;CREATE TABLE document (metadata JSON NOT NULL);CREATE TABLE document (metadata JSONB NOT NULL DEFAULT '{}'::jsonb);