Обсуждение: problem with nested dblink function

Поиск
Список
Период
Сортировка

problem with nested dblink function

От
Bear
Дата:
Hello everyone !

I have a problem with dblink function.
I need to insert data using pl / pgsql function from one server to
another.
The data from server FS4 to server FS3.
This code does not work:

"select dblink ('dbname = ant_trendy port = 5433 host = FS3 user =
postgres password = postgres ', 'insert into rap.5_7_fil (select *
from temp.fil_packet_template)')"

-->temp.fil_packet_template<-- is table from server FS4

Code with nested function dblink works with the Query window but when
it invokes the function inside the pl / pgsql I get the message all
right but the data are not inserted.

Code work with Query window / doesn't work with pl/pgsql function:
"select dblink
(' dbname=ant_trendy port=5433 host=FS3 user=postgres
password=postgres ',
' insert into rap.5_7_fil (select * from dblink ('' dbname=ant_trendy
port=5432 host=FS4 user=postgres password=postgres '', '' select *
from temp.fil_packet_template '')                    as (                      "time" timestamp without time zone,
               tzewn double precision,                      tzas_msc double precision,                      tpow_msc
doubleprecision,                      vflow double precision,                      pwr double precision,
     tpwymco double precision,                      tpwymco_obl double precision,                      tzas double
precision,                     tzas_obl double precision,                      tpow double precision,
  tcwu double precision,                      tcwu_obl double precision,                      tcwu_cyrk double
precision,                     pstat double precision,                      pwr_proc double precision,
   tpow_diff double precision,                      x_rez_1 double precision,                      x_rez_2 double
precision,                     x_rez_3 double precision,                      x_rez_4 double precision
   ))
 
')"

Does call the nested function dblink from  pl / pgsql functions has
there any restrictions?

How can I in a different way to pass data between servers?

Thanks in advance.


Re: problem with nested dblink function

От
Bear
Дата:
I'm sorry, everything is in order.
Today I looked with fresh eyes, a slight adjustment in the calling
function and it works.
Thanks for your attention.

Best regards.
Ps. recently I deal with postgresql and I wanted to consult with you.