EnterpriseDB: The Enterprise Postgres Company Postgres Plus Forums: The PostgreSQL Open Source Database from EnterpriseDB
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

DB Synchronization  XML

Forum Index » Standard Server
Author Message
umesh_rama

Member

Joined: 1 Jul 2010 03:19:58
Messages: 16
Offline

Dear All

Is it possible to implement database synchronization
b/w two database, that are present in two different machine?

Is there any sql statement to synchronize two DB?

Is it possible to select data from the two different DB tables that are present in same schema using select statement?

please help me, how to achieve it.
thank u in advance.

raghavendra_rao

Senior member
[Avatar]

Joined: 2 Sep 2009 06:28:39
Messages: 108
Offline

Hi,

You can achieve the task with the contrib module dblink.

Please find the link below for further information.
http://www.enterprisedb.com/docs/en/8.4/pg/contrib-dblink.html

Best Regards
Raghavendra
EnterpriseDB
Blog: http://raghavt.blogspot.com/
umesh_rama

Member

Joined: 1 Jul 2010 03:19:58
Messages: 16
Offline

installed postgresql-contrib 8.3 version.
and also dump the dblink.sql file from /usr/share/postgresql/8.3/contrib/dblink

when I execute the below command i an getting the following error.

test=# select dblink_connect('dbname=postgres');
ERROR: could not establish connection
DETAIL: fe_sendauth: no password supplied

how to solve the above problems.
please help me.
Vibhor_K

Senior member
[Avatar]

Joined: 3 Jul 2009 09:46:15
Messages: 444
Offline

ERROR: could not establish connection
DETAIL: fe_sendauth: no password supplied


Error itself is pointing to reason for connection failure.

Please try following:
select dblink_connect(,'myconn','host=localhost port=5432 dbname=postgres password=<password>');

"myconn" is a name of connection created. For more information, please refer following link:
http://www.enterprisedb.com/docs/en/8.4/pg/dblink.html#AEN112128

Thanks & Regards,
Vibhor Kumar
Blog:http://vibhork.blogspot.com
[Email] [WWW]
umesh_rama

Member

Joined: 1 Jul 2010 03:19:58
Messages: 16
Offline

Thanks a lot, its working

How to insert / update / delete data to the another DB table?
can u send me the query or link how to achieve it.

This message was edited 1 time. Last update was at 20 Jul 2010 09:35:47

Vibhor_K

Senior member
[Avatar]

Joined: 3 Jul 2009 09:46:15
Messages: 444
Offline

How to insert / update / delete data to the another DB table?


Please use dblink_exec function. Documentation is a best source for finding example and information about dblink_exec. Following is a link:
http://www.enterprisedb.com/docs/en/8.4/pg/contrib-dblink-exec.html

Thanks & Regards,
Vibhor Kumar
Blog:http://vibhork.blogspot.com
[Email] [WWW]
 
Forum Index » Standard Server
Go to:   
Powered by JForum 2.1.8 © JForum Team