【发布时间】:2013-08-17 18:34:45
【问题描述】:
我无法在我的 Postgres 数据库中将名为 key_request 的表中名为 end_date 的列从 time with time zone 更改为 timestamp。我尝试使用以下代码:
alter table key_request alter column end_date type timestamp with time zone using end_date::timestamp with time zone
我不断收到以下错误:
ERROR: cannot cast type time with time zone to timestamp with time zone
知道如何调整此查询以使其正常工作吗?
【问题讨论】:
-
我觉得你写错了,你想把
timestamp without timezone转换成timestamp with timezone,对吧? -
不,该列是带时区的时间,我希望更改为带时区的时间戳
-
哦!抱歉...现在我明白了,我一直在阅读
timestamp而不是time... 哈哈...
标签: sql postgresql timestamp postgresql-9.2 alter