Search Postgresql Archives

Re: Copying only incremental records to another DB..

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

 



On 29 Jun 2009, at 6:10, Phoenix Kiula wrote:

Hi

We're trying PG on a new machine, so we copied our current (live)
database to that server. Tested the code and it's all working. Now, to
make that second server the main live server, we will need to copy the
db again including the new records since we copied for testing. Is
there any way to copy only the incremental records in all the tables?


It would be nice if there were a tool that could do a diff between two dumps resulting in a new dump with just the statements necessary to apply the differences. I don't think there is such a tool yet though (some light Googling does bring up such a tool for sqllite). Implementing it does have a few challenges, changes to records with foreign keys for example.

Barring the availability of such a tool, there are some tools out there that can 'diff' two XML files and, seeing that the xml module can export tables to a pre-defined XML format, you may be able to do something using that. What to do with the resulting XML file is another story, some XSLT could probably turn it back into SQL again.

If the changes aren't many you could probably also work from the results of a normal diff from two text-dumps and glue them back together into a usable dump file. Or just apply the changes by hand...

All of these methods involve a bit of work and none is foolproof (unless the dump-diff tool does exist), but if approached well it could result in a rather useful tool.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,4a6995d910131993413858!



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux