Getting postgres database to work correctly.