Re: Downtime-free 'alter table set tablespace'

Поиск
Список
Период
Сортировка
От Chris Ernst
Тема Re: Downtime-free 'alter table set tablespace'
Дата
Msg-id 537FB9CF.40807@zvelo.com
обсуждение исходный текст
Ответ на Downtime-free 'alter table set tablespace'  (Vincent de Phily <vincent.dephily@mobile-devices.fr>)
Ответы Re: Downtime-free 'alter table set tablespace'
Список pgsql-general
On 05/23/2014 08:57 AM, Vincent de Phily wrote:
> I need to reduce downtime to a minimum, so I can't afford to let "alter table
> set tablespace" take an exclusive lock on the table for the 2h it'll take to
> copy the data.

You might look at pg_repack (https://github.com/reorg/pg_repack).  The
most recent version added the ability to repack a table (or just
indexes) to a new tablespace.  It won't be fast as it will essentially
rebuild the entire table.  But it only needs an exclusive lock for a
brief moment, so there's virtually zero down time and no data loss.

    - Chris





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

Предыдущее
От: Jerry Sievers
Дата:
Сообщение: Re: Downtime-free 'alter table set tablespace'
Следующее
От: David Noel
Дата:
Сообщение: COPY TO returns "ERROR: could not open file for writing: No such file or directory"