I have a table in PostgreSQL that has a character(1)
column, that I want to change to an text[]
column, but I can't seem to get it working:
ALTER TABLE public.mytable
ALTER COLUMN abc TYPE TEXT[] COLLATE pg_catalog."default"
USING ARRAY[abc];
gives me this error:
ERROR: default for column "abc" cannot be cast automatically to type text[]
which is understandanle, because Postgres can't cast NULL:bpchar
to an array. But, how can I get this done then? Apparently, NULL
s can be typed ...