How to create database link and synonym in postgresql 9.0

From: tushar nehete <tpnehete(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: How to create database link and synonym in postgresql 9.0
Date: 2011-10-05 15:08:46
Message-ID: CANuBLQVp1NZ0DsdGpyK+dCBHGFH3Nhpi0DSaUtXiZCbyq2BumA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
In one of the migration porject want to access and update some tables from
other database on same postgresql server.

The question is how to access tables from other database on the same
postgres server.
If it is by database link like Oracle then what is the syntax.
And how to create synonym?

Say i have a postgres server on RHEL5 and it has 2 databases db1 and db2.
db2 has table emp which i want to access from db1.
so i create a dblink in oracle named dblnk_emp and access the table in db1
by
select * from emp(at)dblnk_emp;
so i create synonym for emp(at)dblnk_emp as emp in db1.

In postgres I can access table from other database by dblink but cannot
update it. Also there is
support for synonym.

Please help..

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2011-10-05 15:21:40 function "XXX" already exists with same argument types
Previous Message Filip Rembiałkowski 2011-10-05 14:50:56 Re: Restoring 2 Tables From All Databases Backup