Re: Dataimport from remote db

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Dataimport from remote db
Дата
Msg-id 3102.1215785416@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Dataimport from remote db  ("Schoenit, Tobias AT/BHL-ZTPS" <tobias.schoenit@schaeffler.com>)
Список pgsql-novice
"Schoenit, Tobias  AT/BHL-ZTPS" <tobias.schoenit@schaeffler.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

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Wright, George"
Дата:
Сообщение: Re: function source
Следующее
От: Mark Roberts
Дата:
Сообщение: Re: Number of postgres connections