我需要将PSQL中一张表中的几列进行转换,但我真的不想删除表来解决这个问题(那是我的最后手段)。有没有办法可以做到这一点,因为当我输入以下内容时:
ALTER TABLE table ALTER TABLE column type TIMESTAMP without time zone using column::TIMESTAMP without time zone;
它不能工作,说:
ERROR:cannot cast type time without time zone to timestamp without time zone.
补充一点,如果可能的话,我希望避免删除列,因为我已经使用了这些列的索引。