I do just that. There is no reason to use a different code base for each database. Just put the queries in the right place.
If you have enough RAM you can even run oracle and postgresql at the same time, but I usually stop the database before switching.
All you need to switch is different AOLserver config files to point to the correct database.