Reputation: 5933
I know that I can start a Postgres DB using pg_ctl start -D $DBPATH
, but that'll throw if the DB is already started. How do I start the DB only if it's not already running? Relatedly, how do I check if the DB is already running from only the file system?
Upvotes: 0
Views: 422
Reputation: 248125
For that, use
pg_ctl status -D $DBPATH
See the documentation for details.
Upvotes: 1