Added pg as optional dependency.