I use postgres9.4
, and there exists relation \"Patients\" has column \"contact\" with type jsonb[]
, how to transfer type jsonb[]
to
As of 9.5 version, to preserve the data and keep the data in json as array this would work much better.
ALTER TABLE "Patients" ALTER COLUMN "contact" DROP DEFAULT
ALTER TABLE "Patients" ALTER COLUMN "contact" TYPE jsonb USING to_json(contact)
ALTER TABLE "Patients" ALTER COLUMN "contact" SET DEFAULT '[]'