I want to cast a specific column in my PostgreSQL 开发者_高级运维database from character_varying type to type date. phpPgAdmin gives me the following error:
ERROR: column "date" cannot be cast to type date
In Statement: ALTER TABLE "public"."tablename" ALTER COLUMN "date" TYPE date
What should I do ? Thanks
You might need to convert it to text first:
alter table "foo" alter column "date" type date using ("date"::text::date);
精彩评论