兼容性判定
公开资料依据 · 建议 PoC 复核支持度none
严重度major
置信度low
依据规则ora.func.harvest_orafce_oracle_unistr
怎么改
改 PostgreSQL Unicode escape string 或安装获批 orafce 后调用 oracle.unistr
判定说明
core 无 Oracle UNISTR 同名函数;转义宽度、代理项和数据库编码建议 PoC 复核
库侧 / 应用侧路径
库侧改造
可行:按 rewrite 在目标数据库实现兼容替代,并显式处理类型、NULL 与异常边界
应用侧改造
可行:在应用适配层封装等价逻辑,并统一替换调用点
推荐路线:db_side。验证建议:建议 PoC 复核正常值、NULL、边界值、返回类型与异常行为,并与 Oracle 逐项比对
规则样例
SELECT UNISTR('sample') FROM dual
SELECT UNISTR('other') FROM dual
SELECT APP_UNISTR('sample') FROM dual
参考来源
- https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/UNISTR.html
- https://www.postgresql.org/docs/16/sql-syntax-lexical.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://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Functions.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 怎么改