Moved db actions into a postgres package