Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres, plpgsql: Is there a way to connect to other DB from inside of a stored procedure?

I have two DB's one is feed by filtered data from another, now i'm using perl script witch executes query on foreign DB, stores a result in a csv file, and loads it to local DB using \COPY sytnatx

Is there a way to write plpgsql function witch will connect to foreign DB and load filtered data in local DB ( I know it can be done in ie. plperl, but i search more "native" way )

like image 267
canni Avatar asked Sep 15 '25 08:09

canni


1 Answers

And there is the DBI-LINK that supports much more databases :)

like image 185
Szymon Lipiński Avatar answered Sep 17 '25 23:09

Szymon Lipiński