bloated postgres data folder, clean up

Поиск
Список
Период
Сортировка
От Rémi Cura
Тема bloated postgres data folder, clean up
Дата
Msg-id CAJvUf_ugk3pbcVYjKFHYRCdfkSGdDZ+yCzMyZPHepOh=Loijfw@mail.gmail.com
обсуждение исходный текст
Ответы Re: bloated postgres data folder, clean up  (Peter Devoy <peter@3xe.co.uk>)
Re: bloated postgres data folder, clean up  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-general
Hey dear list,
after a fex years of experiments and crash,
I ended up with a grossly bloated postgres folder.
I had about 8 Go of useless files.
All is in a virtualbox, so I'm sure to be able to reproduce exactly, and fried my postgres folder a couple of time before getting it right.

Julien (Rouhaud) helped me to find those useless files via SQL.
The idea is to list files in postgres directory with `pg_ls_dir`, then to check that the dir name correspond to something useful (using pg_relation_filenode).
------------------
https://gist.github.com/Remi-C/926eaee04d61a7245eb8
------------------

To be sure I export the found files list,
then use oid2name to check that no file is recognized.

files can then be deleted (using plpythonu in my case).

So far a vacuum full analyze raise no errors.

Warning : for this to work, the SQL query must be sent while connected to the database to clean.

Hope this may be useful
Cheers,
Rémi-C

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Only owners can ANALYZE tables...seems overly restrictive
Следующее
От: Geoff Winkless
Дата:
Сообщение: Re: multicolumn index and setting effective_cache_size using human-readable-numbers