兼容性判定
公开资料依据 · 建议 PoC 复核支持度none
严重度major
置信度medium
依据规则ora.func.remainder
怎么改
按 Oracle 舍入规则显式公式改写,或经批准使用 orafce
判定说明
core 无 Oracle REMAINDER;它不等同 MOD,建议 PoC 复核负数、半数舍入与零除
库侧 / 应用侧路径
库侧改造
可行:用显式公式或经批准的兼容扩展实现
应用侧改造
可行:将低频数学计算移应用数值库
推荐路线:case_by_case。验证建议:正负数、半数舍入、小数精度和零除异常对照
规则样例
SELECT REMAINDER(11, 4) FROM dual
SELECT REMAINDER(amount, divisor) FROM calc_t
SELECT MOD(amount, divisor) FROM calc_t
参考来源
- https://github.com/darold/ora2pg/blob/97015451a4d1cfbee888f2e6efe7ff68c239a9b5/lib/Ora2Pg/PLSQL.pm#L88-L223
- https://www.postgresql.org/docs/16/functions-math.html
- https://www.postgresql.org/docs/16/datatype.html
- https://www.postgresql.org/docs/16/functions.html
- https://www.postgresql.org/docs/16/sql-commands.html
- https://github.com/orafce/orafce/blob/841978f4ec493492bb57fd12415959695cae1b64/README.asciidoc#L786-L943
相关改造点
- ORACLE → postgresql 16 全部改造点
- postgresql 16 兼容性总览
- ORACLE 迁移国产库总览
- ORACLE ADD_MONTHS 函数 迁移 postgresql 16 怎么改
- ORACLE ALTER SESSION SET 会话参数 迁移 postgresql 16 怎么改
- ORACLE ANYDATA 动态类型列 迁移 postgresql 16 怎么改
- ORACLE ASCIISTR Unicode 转义函数 迁移 postgresql 16 怎么改
- ORACLE 关联数组(INDEX BY 表) 迁移 postgresql 16 怎么改
- ORACLE AT TIME ZONE 时区表达式 迁移 postgresql 16 怎么改