-- 先从smallint类型改成int类型 alter table public.<表名> alter column <字段名> type int using <字段名>::int; -- 再从int类型改成boolean类型 alter table public.<表名> alter column <字段名> type boolean using <字段名>::boolean; 参考: PostgreSql 报错ERROR: cannot cast type smallint to boolean