SqlServer to Postgres DDL migration/conversion

2019-08-02 15:56发布

We're looking to migrate from MSSQL to Postgres. I'm intending on using sql servers bcp tool for generating csv that we'll import into postgres with the bulk copy features. We are however, having trouble getting the DDL migrated. We've. I've gotten it to work by massaging the DDL generated by MMSQL by hand but We need something automated since we have a moving target (still adding tables, columns etc.) and will need to do this more than once.

We're open to commercial and open source products but have not found anything that does everything we need: Tables, serial columns, indexes (unique, multi column etc), defaults and foreign key constraints.

2条回答
来,给爷笑一个
2楼-- · 2019-08-02 16:21

Check this link http://dbconvert.com/convert-mssql-to-postgre-pro.php?DB=6

Specifically look at the "SQL Azure to PostgreSQL" feature. Hopefully that will handle your table DDL.

NOTE: I have not used this just ran across it at http://www.postgresql.org/ in the latest news section a few days ago.

查看更多
姐就是有狂的资本
3楼-- · 2019-08-02 16:45

Finally settled on using http://www.enterprisedb.com/products-services-training/products-overview/postgres-plus-solution-pack/migration-toolkit. It's the most thorough and does data and ddl. There have been some issues with escaping backslashes that are followed by numbers since postgres thinks these are unicode escape sequences.

查看更多
登录 后发表回答