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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With