文章目录环境症状问题原因解决方案环境系统平台N/A版本4.5.8症状兼容模式为mysql时修改字段类型由smallint类型修改为boolean报错 ERROR: cannot cast type smallint to boolean LINE 1: alter table t2 alter dy type boolean using dy::boolean问题原因smalliint和boolean是不同的类型存储的是不同的值没有办法直接进行数据转换。解决方案先将字段类型由smallint转成integer再转成boolean。highgo# alter table t2 alter dy type int using dy::int;ALTERTABLEhighgo# alter table t2 alter dy type boolean using dy::boolean;ALTERTABLE此时问题解决。