Make changes to use postgresql database.