Re: Dataimport from remote db

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Schoenit, Tobias AT/BHL-ZTPS" <tobias(dot)schoenit(at)schaeffler(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Dataimport from remote db
Date: 2008-07-11 14:10:16
Message-ID: 3102.1215785416@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Schoenit, Tobias AT/BHL-ZTPS" <tobias(dot)schoenit(at)schaeffler(dot)com> writes:
> -- connect to remote database
> PERFORM 'SELECT dblink_connect(''con'', v_constr);';
> RAISE NOTICE 'connected';

> FOR v_config in (SELECT * from dblink('''con''',
> 'SELECT * from config ') AS

> But now I get:
> NOTICE: connected

> ERROR: could not establish connection
> DETAIL: missing "=" after "'con'" in connection info string

You've got too many quotes in the second dblink call (as indeed the
error message shows, if you look carefully).

I'm also pretty sure that the first PERFORM isn't really establishing a
connection --- it looks to me like all it's doing is evaluating a
constant string. You seem to be confused about the difference between
PERFORM and EXECUTE. There is no need for EXECUTE here, so this
would be sufficient:
PERFORM dblink_connect('con', v_constr);

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Mark Roberts 2008-07-11 16:22:52 Re: Number of postgres connections
Previous Message Wright, George 2008-07-11 12:50:08 Re: function source