Empty array as PostgreSQL array column default value
You need to use the explicit array
initializer and cast that to the correct type:
ALTER TABLE public.accounts
ALTER COLUMN pwd_history SET DEFAULT array[]::varchar[];
I tested both the accepted answer and the one from the comments. They both work.
I'll graduate the comments to an answer as it's my preferred syntax. 🙂
ALTER TABLE public.accounts
ALTER COLUMN pwd_history SET DEFAULT '{}';