exists

Function exists 

Source
pub fn exists<P: AsRef<Path>>(datadir: P) -> bool
Expand description

A fairly simplistic but quick check: does the directory exist and does it look like a PostgreSQL cluster data directory, i.e. does it contain a file named PG_VERSION?

version() provides a more reliable measure, plus yields the version of PostgreSQL required to use the cluster.