Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group