March 21st, 2003, 11:45 AM
Data transfer between databases in PostgreSQL
Can anyone suggest a good method to perform data transfer frequently (let us say every 10 minutes) between 2 databases in PostgreSQL (on Linux) on the same machine ?
Thanks in advance for your suggestions.
March 23rd, 2003, 11:35 PM
the only way i can think of doing this is using a sql dump and then running the sql in the other db. dont know how efficient it would be and i dont think i would like it to be running every 10 minutes
March 24th, 2003, 11:15 AM
The cheap and easy way is to automate pg_dump and restore between the two, which should work fine as long as your integrity rules are properly thought out and enforced on the database. But this is not as efficient or safe as full replication:
According to the PGReplication project, replication is now available for PostgreSQL 7.2, although it is still in development. It should be available for 7.3 soon.
September 21st, 2003, 11:41 AM
Would this work with one table having more columns than the other ?
September 21st, 2003, 07:21 PM
not with just a pg_dump of the data and restore; you could write a PL/pgSQL function that would do it when you ran it, or most easily you can just have a trigger that would always insert into the other table when there was an insert on the first one but that would also be a PL/pgSQL function