开发者

PostgreSQL - ERROR: column "date" cannot be cast to type date

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜