Re: Copying only incremental records to another DB..

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Copying only incremental records to another DB..
Дата
Msg-id A0AEB27E-AD7B-4BB3-9E69-0411ABAF2F45@solfertje.student.utwente.nl
обсуждение исходный текст
Ответ на Copying only incremental records to another DB..  (Phoenix Kiula <phoenix.kiula@gmail.com>)
Ответы Re: Copying only incremental records to another DB..
Список pgsql-general
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!



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

Предыдущее
От: Jazz Johal
Дата:
Сообщение: Replication from Postgres to EDB
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: Copying only incremental records to another DB..