Re: Database Link between 2 PostgreSQL db

From: Robby Russell <robby(at)planetargon(dot)com>
To: "Reuben D(dot) Budiardja" <techlist(at)voyager(dot)phys(dot)utk(dot)edu>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Database Link between 2 PostgreSQL db
Date: 2005-03-12 20:19:15
Message-ID: 1110658755.20824.559.camel@linus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 2005-03-12 at 15:00 -0500, Reuben D. Budiardja wrote:
> Hello,
> Oracle has a concept of Database link, IE you can access data from a table in
> different database, even if the database is in different host, using
> something like
>
> SELECT * FROM table(at)REMOTE_CONNECT;
>
> Is there something similar in PostgreSQL? I would like to know if I can access
> my data on a remote PostgreSQL server from a local PostgreSQL database.
>
> Thank you in advance for any respond.
>
> RDB

You can use dblink.

> dblink - Functions to return results from a remote database
>

http://www.postgresql.org/docs/current/static/queries-table-expressions.html

example:

> SELECT *
> FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc')
> AS t1(proname name, prosrc text)
> WHERE proname LIKE 'bytea%';
>

Cheers,

Robby

--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON | www.planetargon.com
* Portland, OR | robby(at)planetargon(dot)com
* 503.351.4730 | blog.planetargon.com
* PHP-PostgreSQL Hosting & Development
* open source solutions - web hosting
****************************************/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Rylander 2005-03-12 20:24:20 Re: partitionning
Previous Message Reuben D. Budiardja 2005-03-12 20:00:10 Database Link between 2 PostgreSQL db