I have multiple installations of Postgres on my MacOS Mojave machine. Version 10.7 is running, and I want to shut it down, in order to start 9.6.
It's definitely running:
$ psql -h localhost -U postgres
Password for user postgres:
psql (9.6.11, server 10.7)
But I can't stop it:
/Library/PostgreSQL/10 $ bin/pg_ctl stop
pg_ctl: PID file "/usr/local/var/postgresql@9.6/postmaster.pid" does not exist
Is server running?
Nor with the 9.6 version of pg_ctl:
$ pg_ctl stop
pg_ctl: PID file "/usr/local/var/postgresql@9.6/postmaster.pid" does not exist
Is server running?
$ which pg_ctl
/usr/local/opt/postgresql@9.6/bin/pg_ctl
How can I shut down the server, when pg_ctl doesn't seem to be able to control it? I don't recall starting it - perhaps it automatically started when the machine last rebooted. I think I installed it with Homebrew but I'm not certain.