move setting up of postgresql database into separate class, so it's easier to handle when it occurs on a different node