兼容性判定
公开资料依据 · 建议 PoC 复核支持度partial
严重度major
置信度low
依据规则ora.func.harvest_orafce_oracle_rtrim
怎么改
RTRIM(...) -> oracle.rtrim(...)(orafce 4.16;目标原生兼容层按 capability 判定)
判定说明
core 可组合 trim/length/ltrim/rtrim/position/substr,但 Oracle 的 CHAR、空串、NULL、start=0 和字符计数边界不透明等价;建议 PoC 复核
库侧 / 应用侧路径
库侧改造
可行:按 rewrite 在目标数据库实现兼容替代,并显式处理类型、NULL 与异常边界
应用侧改造
可行:在应用适配层封装等价逻辑,并统一替换调用点
推荐路线:db_side。验证建议:建议 PoC 复核正常值、NULL、边界值、返回类型与异常行为,并与 Oracle 逐项比对
规则样例
SELECT RTRIM('sample') FROM dual
SELECT RTRIM('other') FROM dual
SELECT APP_RTRIM('sample') FROM dual
参考来源
- https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Functions.html
- https://www.postgresql.org/docs/16/functions-string.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/orafce--4.16.sql
相关改造点
- 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 怎么改