兼容性判定
公开资料依据 · 建议 PoC 复核支持度none
严重度blocker
置信度medium
依据规则my.func.weight_collation
怎么改
按业务选择目标 collation,禁止复用 MySQL weight bytes
判定说明
排序权重与 collation 实现/版本绑定,无透明等价函数;索引和分页建议 PoC 复核
库侧 / 应用侧路径
库侧改造
可行:建立字符样本对账后显式 COLLATE 并重建索引
应用侧改造
可行:跨库稳定排序可使用版本化 sort key 服务
推荐路线:case_by_case。验证建议:大小写、重音、宽度、汉字、emoji、唯一索引和分页边界对账
规则样例
SELECT WEIGHT_STRING(name) FROM customer ORDER BY 1
SELECT COLLATION(display_name) FROM customer
SELECT CHAR_LENGTH(display_name) FROM customer
参考来源
- https://dev.mysql.com/doc/refman/8.4/en/string-functions.html
- https://www.postgresql.org/docs/16/collation.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 怎么改