Postgres JSON

PostgreSQL documentation recommends usage of jsonb

Postgre JSON Functions
PostgreSQL JSON Update
 
 

add json column

ALTER TABLE table ADD COLUMN "jsisonb" jsonb not null default '{"datas": [{},{}]}'; ALTER TABLE table ADD COLUMN "jeison" json not null default '{"datas": [{},{}]}'::jsonb;
 
SELECT jsonb->'datas' FROM table;
 

remove column

ALTER TABLE "table" DROP COLUMN "jeison"
 
 
 
 
 
 

size limit

  • 255mb jsonb
  • 1gb json (text)
 
 
 

 

Recommendations