我有一个整型非空默认值为0的字段,我需要将其更改为bool.
这就是我正在使用的:
ALTER TABLE mytabe
ALTER mycolumn TYPE bool
USING
CASE
WHEN 0 THEN FALSE
ELSE TRUE
END;
但我得到了:
ERROR: argument of CASE/WHEN must be type boolean, not type integer
********** Error **********
ERROR: argument of CASE/WHEN must be type boolean, not type integer
SQL state: 42804
有什么 idea 吗?
谢谢