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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



clingareddy@xxxxxxxxxxxxx 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

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux