兼容性判定
公开资料依据 · 建议 PoC 复核支持度none
严重度critical
置信度low
依据规则ora.type.integer_alias_range
怎么改
默认 INT/INTEGER/SMALLINT -> numeric(38),值域证明后再压窄
判定说明
Oracle ANSI 整数别名按 NUMBER(38) 值域,不能机械映射到32/16位;建议 PoC 复核
库侧 / 应用侧路径
库侧改造
可行:按目标矩阵 rewrite 改列类型;仅在临时 schema 建代表表,成功/失败路径均 DROP 临时对象并 DROP 临时 schema,建议 PoC 复核
应用侧改造
可行:同步核对驱动/ORM 类型、边界值、NULL、默认值和序列化契约,建议 PoC 复核
推荐路线:db_side。验证建议:覆盖上下界、NULL、默认值、往返、索引和驱动元数据;成功/失败路径均 DROP 临时对象与临时 schema 并确认零残留,建议 PoC 复核
规则样例
CREATE TABLE t (id INTEGER)
DECLARE n SMALLINT; BEGIN NULL; END;
DECLARE a NUMBER; b INTEGER; BEGIN NULL; END;
参考来源
- https://github.com/darold/ora2pg/blob/97015451a4d1cfbee888f2e6efe7ff68c239a9b5/doc/Ora2Pg.pod#L2102-L2308
- https://dev.mysql.com/doc/refman/8.4/en/data-types.html
- https://learn.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql
- 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/Data-Types.html
相关改造点
- 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 怎么改