docker 使用pgloader 迁移mysql到pgsql?

pgloader mysql://root:123qwe@host.docker.internal/project_test_1  postgresql://postgres@localhost/postgres   此时mysql的tinyint字段会被自动转换成smallint  如何添加cast参数 使tinyint转换成bool呢?

参与7

2同行回答

沈天真沈天真售前支持IPS
可以使用 pgloader  的转换函数https://pgloader.readthedocs.io/en/latest/ref/transforms.htmltinyint-to-booleanAs MySQL lacks a proper boolean type, tinyint is often used to implement that. This function transforms 0 to ‘false’ and anything else to...显示全部

可以使用 pgloader  的转换函数
https://pgloader.readthedocs.io/en/latest/ref/transforms.html

  • tinyint-to-boolean

As MySQL lacks a proper boolean type, tinyint is often used to implement that. This function transforms 0 to ‘false’ and anything else to _‘true_’.

收起
硬件生产 · 2022-01-14
浏览1158

提问者

问题来自

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2022-01-14
  • 关注会员:3 人
  • 问题浏览:1934
  • 最近回答:2022-01-14
  • X社区推广