changing postgres to a singleton