views:

53

answers:

2

I'm starting a new opensource project (for real estate) and wanted to focus on using MySQL, but would also like to ensure it works in PostgreSQL. What is the best way to doing this without having to continually test in both environments? I'm assuming the db schema is close to the same, but there could be some differences on the SQL script to set up the databases - right? what about scripts?

A: 

Seems to me that the only way to make absolutely sure is to target them both in your testing. I'm sure both DB's have development paths that may diverge, and you'll often find yourself faced with the prospect of using some MySQL-specific feature.

It's a PITA but the longer you go between tests against both the better the chance you'll have fireworks when you do.

n8wrl
Both mysql and PostgreSQL support ANSI SQL so as long as your discipled about only using ANSI SQL you will be fine, the easiest way to do that is just use an ORM and let it figure out how to create the SQL
Bob The Janitor
+1  A: 

What Development environment are you using?

if your using .NET, JAVA you could use an ORM(Object Relational Mapper) like Hibernate (NHibernate for .net) and that will take care of you db interoperability, for PHP or ruby I would look for something equivalent.

Edit point: After looking at your profile it looks like your a python developer so you may find this link helpful what are some good python orm solutions posed on SOF 10 months ago

Bob The Janitor