Re: Cross database reference (databases are on the same - Mailing list pgsql-general

From scott.marlowe
Subject Re: Cross database reference (databases are on the same
Date
Msg-id Pine.LNX.4.33.0304081601280.20181-100000@css120.ihs.com
Whole thread Raw
In response to Re: Cross database reference (databases are on the same database cluster)  (Flower Sun <sun_2002_flower@yahoo.com>)
Responses Re: Cross database reference (databases are on the same  (Joe Conway <mail@joeconway.com>)
List pgsql-general
On Tue, 8 Apr 2003, Flower Sun wrote:

>
> Hi, Scott,
> Thank you for your reply. Can you give us a sample of using the first method using dblink?
> (My postgresql server is 7.2 preinstalled while installing redhat 8.0, I even cannot find the */contrib/* directory
youmentioned). 
>  "scott.marlowe" <scott.marlowe@ihs.com> wrote:On Tue, 8 Apr 2003, Flower Sun wrote:

You may or may not have the contrib directory.  While I use redhat, I've
always run Postgresql from a tar.gz build, so I've always had the contrib
directory laying around.  I think you could probably just download 7.2.4
and use the contrib directory from there for dblink.  It has lots of
examples in it on how to use it in the /contrib/dblink/doc directory.

For example:

select dblink_connect('dbname=template1');
 dblink_connect
----------------
 OK
(1 row)

test=# select * from dblink('dbname=template1','select proname, prosrc
from pg_proc')
 as t1(proname name, prosrc text) where proname like 'bytea%';
  proname   |   prosrc
------------+------------
 byteacat   | byteacat
 byteaeq    | byteaeq
 bytealt    | bytealt
 byteale    | byteale
 byteagt    | byteagt
 byteage    | byteage
 byteane    | byteane
 byteacmp   | byteacmp
 bytealike  | bytealike
 byteanlike | byteanlike
 byteain    | byteain
 byteaout   | byteaout
(12 rows)

so, it's pretty much a function set that connects to the other database
and lets you pull in data from it.


pgsql-general by date:

Previous
From: Flower Sun
Date:
Subject: Re: Cross database reference (databases are on the same database cluster)
Next
From: Joe Conway
Date:
Subject: Re: Cross database reference (databases are on the same