Ticket #123 (reopened defect)

Opened 1 year ago

Last modified 6 months ago

Reconciling a table in one database with a table in another, remote database

Reported by: Peter Geoghegan Assigned to: jtv
Priority: normal Milestone:
Component: other Version:
Severity: normal Keywords:
Cc:

Description

I apologise if I'm misusing the ticket system by posting what is essentially an enquiry or a feature request, but there isn't a message board for technical discussion that do not relate to fixing bugs, which perhaps there should be. I'd certainly be an active participant in such a message board if there was.

I'm implementing a distributed database. I need to reconcile two tables, one in one database, the other in another, on a remote server. If they were in the same database, I might perform an EXCEPT based enquiry, then increment through the results, updating the second table (well, actually, I'd probably do a union, but that's probably not possible at all with remote databases, and as such doesn't illustrate my point.)

Here's the SQL:

SELECT * FROM NEWTABLEMASTER

EXCEPT

SELECT * FROM OLDTABLESLAVE;

I now increment through the std::vector-style container class, "result", updating the second database's OLDTABLESLAVE table as I increment, until the two databases have been reconciled.

I want to have two concurrent database connections, one a localhost connection, the other a remote connection, each with a table that is reconciled with the other table in this way (or even in another, more efficient way that hasn't occurred to this SQL novice), using libpqxx. Is this possible?

Regards, Peter Geoghegan

Attachments

Change History

09/11/07 21:16:01 changed by jtv

There is a technical discussion forum: the libpqxx-general mailing list! See the front page of pqxx.org for links.

I don't have a complete picture of what it is you want to do, but several things spring to mind:

  • If you just want to query and manipulate several databases simultaneously from the same process, that is no problem. Just open multiple connections.
  • For now libpqxx has no two-phase commit support, so you will not have the option of reconciling two databases to that degree.
  • If you want to keep database instances perfectly synchronized, consider Slony. It's a full replication implementation for postgres that, from what I understand, is well-integrated.

04/27/08 05:50:00 changed by jtv

  • status changed from new to closed.
  • resolution set to fixed.

05/13/08 02:46:41 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

Add/Change #123 (Reconciling a table in one database with a table in another, remote database)




Change Properties
Action