Re: Remote connections? - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Remote connections?
Date
Msg-id 3C0FEB2C.70000@home.com
Whole thread Raw
In response to Remote connections?  (mlw <markw@mohawksoft.com>)
List pgsql-hackers
mlw wrote:

> I too find the internals of PostgreSQL virtually incomprehensible at the
> internal level. If there were a document somewhere which published how a
> function could return multiple tuples, remote views would be a trivial
> undertaking. It could look like:
> 
> select * from remote('select *from table', 'user=postgres host=outland
> db=remote');
> 

See contrib/dblink in the 7.2 beta. It was my attempt inspired by 
Oracle's dblink and some code that you (mlw) posted a while back. Based 
on the limitations wrt returning muliple tuples, I wound up with 
something like:

lt_lcat=# select dblink_tok(t1.dblink_p,0) as f1 from (select 
dblink('hostaddr=127.0.0.1 dbname=template1 user=postgres 
password=postgres','select proname from pg_proc') as dblink_p) as t1;

Which, as has been pointed out more than once, is pretty ugly, but at 
least it's a start ;-)


Joe



pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: [GENERAL] java stored procedures
Next
From: Alex Pilosov
Date:
Subject: Re: Remote connections?