I'm on Mac 10.13.6. I restarted my machine and Postgres, which normally starts upon restart, wasn't running. Sadly, I cannot remember how or where I installed it. I'm able to locate instances of "pg_ctl"
sudo find / -name "pg_ctl"
returns
/usr/local/bin/pg_ctl
/usr/local/Cellar/postgresql/9.6.1/bin/pg_ctl
/usr/local/Cellar/postgresql/9.5.0/bin/pg_ctl
/usr/local/Cellar/postgresql/9.6.15/bin/pg_ctl
/usr/local/Cellar/postgresql@9.6/9.6.15/bin/pg_ctl
/usr/local/Cellar/libpq/11.5/bin/pg_ctl
/usr/local/Cellar/postgresql@9.5/9.5.19/bin/pg_ctl
However, I need to tell it a data directory in order for it to start, and I can't figure out how to know the data directory while the server is down. What kind of files should I look for to figure out where the data directory is?
Best Answer
Check
/usr/local/var/postgres
See also answers for Mac in How do I find PostgreSQL's data directory?.
A Linux PGDATA directory looks like: