Re: Archeiving and Purging

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Archeiving and Purging
Дата
Msg-id 550A4368.80906@hogranch.com
обсуждение исходный текст
Ответ на Archeiving and Purging  (adityagis <adityakumar529@gmail.com>)
Ответы Re: Archeiving and Purging  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On 3/18/2015 7:20 AM, adityagis wrote:
>   I have lots of data in my DB. I need to do archeiving and purging of my
> data.
> Can anyone please help me with step by step riles?

like this?

select * from table where datefield < current_date-interval '6 months';
delete from table where datefield < current_date-interval '6 months';

obviously, save the data you selected in a suitable archive file. repeat
this for each table you wish to 'archive and purge'.

alter the interval with whatever criteria you want to use for this
archive and purge operation.





--
john r pierce, from the mid left coast



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

Предыдущее
От: adityagis
Дата:
Сообщение: Archeiving and Purging
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Archeiving and Purging