To fix errors like..
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
...
could not open directory "pg_tblspc": No such file or directory
...
could not open directory "pg_commit_ts": No such file or directory
Run this command:
mkdir /usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat,pg_stat_tmp,pg_replslot,pg_snapshots,pg_commit_ts}/
and start again:
pg_ctl -D /usr/local/var/postgres start
or
brew services start postgresql