简体   繁体   中英

How can I restore a postgresql dump to a SQL Server instance?

I've got a production app running on Postgres, and I'm taking nightly dumps to a tar.gz file. I'd like to restore this dump to a separate SQL Server database instance. Are there any direct (or indirect) ways to do this in an automated fashion?

If all you wanted to do is replay the DML statements that may work just fine assuming you have the tables in the target in place. But if you want the script to create tables and the other objects the vast majority of those statements will fail without you manually going in and updating them to work on SQL Server. You may find some company that has a tool that tries to do this and in some cases they can be ok for all the easy conversions but will fail on all the complicated stuff. Overall SQL Server and PostgreSQL are two different beasts when you get into the details so doing this automatically will be hard without writing some conversion tool or trying to buy one that will probably only get you 60 to 80 percent were you want..

Yes, you can create a DTS job to import from the dump on timely basis.

http://msdn.microsoft.com/en-us/library/cc917688.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM