Macのpostgresqlを掃除する

January 04, 2015

Macの掃除の途中です。今回はあまり使っていなかったpostgresqlのディレクトリが24GBもあって絶対無駄なものがたくさんあるので掃除してみようと思いました。

Big

手順

とりあえずデータベースの一覧を表示。

psql -l

うぶなかんじ。

                                 List of databases
    Name         |  Owner  | Encoding |   Collate   |    Ctype    |  Access privileges

---------------------+---------+----------+-------------+-------------+--------------------- blogapp | ******* | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | ************* | ******* | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | ************* | ******* | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | postgres | ******* | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | ************* | ******* | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/namorit ******* | | | *******=CTc/******* ************* | ******* | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/******* + | | | | | *******=CTc/******* ************* | ******* | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | ************* | ******* | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | (8 rows)

使っていないdbの削除。

dropdb <データベース名>

だいぶ軽くなった〜。

Mongo

参考


Profile picture

Written by morizotter who lives and works in Tokyo building useful things. You should follow them on Twitter