failed to find conversion function from boolean to integer

1.1.前置条件

目标库:V9.0.5.1

源库:MySQL

1.2、问题描述

select xmmc,xmbh,cjr,cjsj,smms
from
sq_xmjbxx a
where
a.del_flag = 1;

报错:failed to find conversion function from boolean to integer

1.3、操作步骤

-- 1、查询已有的隐式转换
select
OID,castsource ,(select typname from pg_type where oid = castsource) as castsourcename ,
casttarget , ( select typname from pg_type where oid = casttarget) as casttargetname ,
castfunc , ( select proname from pg_proc where oid = castfunc ) as castfuncname,
castcontext ,
CASE castcontext::text
WHEN 'e'::text THEN '禁止'::text
WHEN 'a'::text THEN '赋值'::text
WHEN 'i'::text THEN '全部'::text
END
from pg_cast where
castsource in( select oid from pg_type
where typname like '%boo%' )
and casttarget in( select oid from pg_type
where typname like '%int%' );
-- 2、结果,存在一个仅赋值的隐式转换
10035 16 bool 23 int4 2558 int4 e 禁止
-- 3、修改这个为全部
update pg_cast set castcontext='i' where oid =10035

1.4、预期结果

SQL可以正常执行,查询结果正常

1.5、异常处理

暂未发现相关异常场景

1.6、回滚方案

update pg_cast set castcontext='e' where oid =10035

1.7、典型场景示例

用户在使用源库MySQL时,使用了很多不同类型数据比较、赋值等