add support for postgres to v3.1.7

Please review.. this should allow a user to use a postgres database or a mysql database.