Chris, > I was thinking a pg_export utility that can output to a range of other > databases SQL formats would also be a good idea. It would share about > 90% of the pg_dump code, but I'm trying to think of how to avoid > duplicating the code.
I'm not really keen on this idea unless you're eager to make a 5-year commitment to maintain the code. The load formats of other RDBMSes change all the time -- MySQL is a particularly egregious example, with 2 incompatible changes in the last year -- and it would become a pain to keep track. More to the point, there are a number of 3rd-party OSS and proprietary utilities which can do this kind of format conversion. For example, Perl DB::Interpolator will cover PG, MySQL, Oracle and MSSQL once that functionality is out of beta. I can see, though, having a --strict-sql switch for pg_dump which would dump all database objects in strict SQL92, which should be pretty compatible with other systems. This should also be easier to implement and trivial to maintain. Though it would mean not dumping functions and doing a few data type conversions. -- Josh Berkus Aglio Database Solutions San Francisco ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings