兼容性判定
公开资料依据 · 建议 PoC 复核支持度none
严重度blocker
置信度medium
依据规则my.func.uuid_short
怎么改
按排序/分片契约选择 bigint sequence、雪花 ID 或 uuid
判定说明
MySQL UUID_SHORT 是拓扑相关 64 位数,不等价 PG uuid;建议 PoC 复核外部契约
库侧 / 应用侧路径
库侧改造
可行:按排序/分片需求选择 identity、sequence 或 UUID
应用侧改造
可行:分布式 ID 服务生成并版本化协议
推荐路线:case_by_case。验证建议:并发唯一、跨节点、重启、排序性和最大值范围回归
规则样例
SELECT UUID_SHORT()
INSERT INTO orders(id) VALUES(UUID_SHORT())
SELECT UUID()
参考来源
- https://dev.mysql.com/doc/refman/8.4/en/miscellaneous-functions.html
- https://www.postgresql.org/docs/16/datatype-uuid.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/darold/ora2pg/blob/97015451a4d1cfbee888f2e6efe7ff68c239a9b5/lib/Ora2Pg/PLSQL.pm#L273-L327
相关改造点
- MYSQL → postgresql 16 全部改造点
- postgresql 16 兼容性总览
- MYSQL 迁移国产库总览
- 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 怎么改