2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

macOSのPostgreSQL(Postgres.app)のアンインストール方法

Posted at

はじめに

MacでPostgreSQLをGUIのPostgres.appで使用している場合のアンインストール方法について記載いたします。
アンインストールだけではなく、メジャーアップデートを行う場合の方法は以下で解説しております。データの移行等が必要な方は以下をご参照ください。
macOSでPostgres.appを使用している場合のメジャーアップデート(データ移行有)

環境

項目 情報
OS macOS Ventura 13.1
プロセッサ 1.6 GHz デュアルコアIntel Core i5
PostgreSQL 14.6

アンインストール方法

旧バージョンのサーバ停止

Postgres.appを開き、旧バージョンのサーバを停止する。
postgres_install_1.png
postgres_install_2.png

停止したらPostgres.appは閉じる。

旧バージョンのPostgres.appの削除

ApplicationsフォルダのPostgres.appをゴミ箱に移動する。

旧バージョンのデータディレクトリ削除

ターミナルで以下のコマンドを実行し、旧バージョンのPostgreSQLのデータディレクトリを削除する。

$ rm -rf ~/Library/Application\ Support/Postgres
$ ls -ld ~/Library/Application\ Support/Postgres
ls: /Users/ngnmsn/Library/Application Support/Postgres: No such file or directory

旧バージョンの設定削除

ターミナルで以下のコマンドを実行し、旧バージョンのPostgreSQLの設定を削除する。

$ defaults delete com.postgresapp.Postgres2

旧バージョンの$PATHコマンドラインツールの構成削除

ターミナルで以下のコマンドを実行し、旧バージョンの$PATHコマンドラインツールの構成を削除する。

$ sudo rm /etc/paths.d/postgresapp

アンインストールの確認

ターミナルで以下のコマンドを実行し、PostgreSQLがアンインストールされていることを確認する。

$ psql --version
fish: Unknown command: psql

以上となります。

2
0
0

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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?