1
我有一個是這樣定義的表:更改列類型爲timestamp
CREATE TABLE session_requests
(
id character varying(255) NOT NULL,
authorization_enc character varying(255),
auto_close integer,
date_created character varying(255) DEFAULT '1970-01-01 01:00:00'::character varying,,
....
)
我試圖做
alter table session_requests alter column date_created type timestamp using date_created::timestamp;
是我得到的錯誤是
ERROR: default for column "date_created" cannot be cast automatically to type timestamp
任何人有任何建議嗎?
首先需要滴/刪除默認值。然後你可以改變數據類型。 – 2014-11-04 15:26:09
@a_horse_with_no_name我希望不要去那裏......但你的建議肯定會奏效。 – treaz 2014-11-04 15:38:05