开发者

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

开发者 https://www.devze.com 2023-03-05 16:37 出处:网络
I want to cast a specific column in my PostgreSQL 开发者_高级运维database from character_varying type 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

精彩评论

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

关注公众号