Re: how to take export of one year data from large database which contain 4 years of data.

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: how to take export of one year data from large database which contain 4 years of data.
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B50FE492C@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на how to take export of one year data from large database which contain 4 years of data.  (clingareddy@vsoftcorp.com)
Список pgsql-admin
clingareddy@vsoftcorp.com wrote:
> My database contains 4 years of data, but i want to migrate only one year i.e 2015 of data to another
> database.
> 
> Please help me how to take export of one year data. Is there any bus_date condition we can use while
> exporting?

PostgreSQL does not know when a row was created.

If you want to export only part of a table, you can do that with:
COPY (SELECT <part of the table>) TO <filename>;

You'd have to come up with appropriate SELECT statements for each affected table,
and you would end up with one export file per table.

A bit tedious, but it can be done.

Another option would be to create a copy of the database, delete everything
that is old and dump the remaining data.

Yours,
Laurenz Albe

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

Предыдущее
От: clingareddy@vsoftcorp.com
Дата:
Сообщение: how to take export of one year data from large database which contain 4 years of data.
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: how to take export of one year data from large database which contain 4 years of data.