Complete initial integration with postgres db.