FOREIGN TABLE with dblink

From: Jasmin Dizdarevic <jasmin(dot)dizdarevic(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: FOREIGN TABLE with dblink
Date: 2011-06-16 10:40:23
Message-ID: BANLkTimcdEodPKRFhJfayg+58ra2vxr=AQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

is there any way to use the new foreign table feature with dblink?
That's almost clear to me:

CREATE FOREIGN DATA WRAPPER pgsql90;

CREATE SERVER srvlocal90 FOREIGN DATA WRAPPER pgsql90 OPTIONS (hostaddr
'127.0.0.1', dbname 'lotty');

CREATE USER MAPPING FOR pgsql SERVER srvlocal90 OPTIONS (user 'pgsql',
password '');

I would like to replace this

SELECT dblink_connect('myconn', 'srvlocal90');
SELECT * FROM dblink('myconn', 'select * from mytests.fttest') AS t(id int,
myname text);

to something like this:

CREATE FOREIGN TABLE mytests.lnkto90_fttest (
id int,
myname text
)
SERVER srvlocal90 OPTIONS (????)

SELECT * FROM mytests.lnkto90_fttest;

Ty

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2011-06-16 10:43:13 Re: You could be a PostgreSQL Patch Reviewer!
Previous Message Dave Page 2011-06-16 10:38:04 Re: Re: [GENERAL] Symbols and versioning of binary releases; running a symbol server