mysql2pgsql_使用mysql2pgsql将数据库从MySql传输到Postgres时出错

在尝试将Python/Django应用从MySQL迁移到Heroku的Postgres时,使用mysql2pgsql工具遇到错误:'unknown datetime(6)'。这个问题发生在处理auth_user表时,尽管该表由Django默认应用生成。解决方案是在postgres_writer.py文件中修改datetime类型的检查,添加对'datetime('类型的处理。
摘要由CSDN通过智能技术生成

bd96500e110b49cbb3cd949968f18be7.png

In order to host my Python/Django app on Heroku, I'm trying to convert my db from MySQL to Postgres following the instructions on https://realpython.com/blog/python/migrating-your-django-project-to-heroku/. I'm currently running OSX 10.9, and am using the tool mysql2pgsql to make the transfer.

When I try to run the command "py-mysql2pgsql -v -f mysql2pgsql.yml" to actually transfer the db, it copies over the first three tables, and then hits a snag on auth_user, returning the error "raise Exception('unknown %s' % column['type']) Exception: unknown datetime(6)". This seems strange, because auth_user is generated by one of Django's default installed apps, so I wouldn't expect it to cause any errors.

Any idea what could be causing this

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值