Re: Database Link between 2 PostgreSQL db - Mailing list pgsql-general

From Robby Russell
Subject Re: Database Link between 2 PostgreSQL db
Date
Msg-id 1110658755.20824.559.camel@linus
Whole thread Raw
In response to Database Link between 2 PostgreSQL db  ("Reuben D. Budiardja" <techlist@voyager.phys.utk.edu>)
List 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@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@planetargon.com
* 503.351.4730  | blog.planetargon.com
* PHP-PostgreSQL Hosting & Development
* open source solutions - web hosting
****************************************/


pgsql-general by date:

Previous
From: "Reuben D. Budiardja"
Date:
Subject: Database Link between 2 PostgreSQL db
Next
From: Mike Rylander
Date:
Subject: Re: partitionning