LoginSignup
9

More than 5 years have passed since last update.

Mac OSでEnterpriseDBからGUIインストールしたPostgreSQLのサービス停止など

Posted at

EnterpriseDBからダウンロードしてGUIインストールしたPostgreSQLは、pgAdminなんかも入ってて楽なんだけど、サービスも自動起動するようになったりしてMacBook Airなんかのモバイルではちょっと電力的に不安を感じたりしたので止め方など。

サービスの停止

PostgreSQLサーバーのdaemonが停止

$ sudo launchctl unload /Library/LaunchDaemons/com.edb.launchd.postgresql-x.x.plist  

サービスの削除

PostgreSQLサーバーの自動起動をやめる。削除ではなくバックアップとしてmvでもよい

$ sudo rm /Library/LaunchDaemons/com.edb.launchd.postgresql-x.x.plist 

手動でのPostgreSQLサーバーの起動/停止

自動起動を停止したので、必要に応じてPostgreSQLサーバーを起動したい場合。

$ sudo -u postgres pg_ctl -D /Library/PostgreSQL/x.x/data start
$ sudo -u postgres pg_ctl -D /Library/PostgreSQL/x.x/data stop

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9