Reorganised so postgres stuff is in right place