我有一个包含jsonb
格式列的表,其中包含如下数据:
['A', 'B', 'C']
我想将列转换为数组列类型,但我不知道如何正确完成. 我的脚本 struct 示例:
ALTER TABLE "products" ADD COLUMN "test_array" VARCHAR(2)[];
UPDATE "products" SET test_array = do converting here;
ALTER TABLE "products" DROP COLUMN "test";
ALTER TABLE "products" RENAME COLUMN "test_array" TO "test";