[Postgres-xl-general] dblink and importing data from external database
Victor D.
dorofeen at gmail.com
Mon Apr 13 14:36:59 PDT 2015
Hello,
I tried to use dblink connection to create a table in a local postgres-xl
database from SELECT statement running on remote database. So the first
connection query is:
SELECT dblink_connect('conn', 'host=localhost port=5492 dbname=remotedb
user=dbuser password=dbpwd client_encoding=utf8');
Then the query:
SELECT * INTO loctable1 FROM dblink('conn', 'SELECT col1, col2 FROM
remtable1') AS t1(col1 text, col2 text);
came to failure with the message:
ERROR: could not establish connection
DETAIL: missing "=" after "conn" in connection info string
But when I use immediately in the same session the same query as above, but
without table creation:
SELECT * FROM dblink('conn', 'SELECT col1, col2 FROM remtable1') AS t1(col1
text, col2 text);
everything works flawlessly.
I would greatly appreciate any advice how to solve that issue.
The database user has full superuser rights. The postgres-xl is installed
on 4 virtual nodes with Ubuntu 14.04.
I tried to execute the queries using psql tool. The host of remote database
is connected using ssh tunnel like:
ssh user at remotehost -L 5492:localhost:5432
Thanks in advance,
Victor Dorofeenko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/pipermail/postgres-xl-general-postgres-xl.org/attachments/20150413/8dd32ed5/attachment.htm>
More information about the postgres-xl-general
mailing list