Postgres, plpgsql: Is there a way to connect to another database from within a stored procedure?

I have two DBs, one of which is sent by filtering data from the other, now I use a perl script witch to query a foreign database, save the result in a csv file and load it into a local database using \ COPY sytnatx

Is there a way to write a plpgsql function that will connect to someone else's database and load the filtered data into a local database (I know this can be done in ie plperl, but I'm looking for a more โ€œnativeโ€ way)

+3
source share
3 answers

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

+2

PostgreSQL dblink, PostgreSQL, - , .

+2

PL/Proxy, - ( , , ) , PL/Proxy . Skype .

0

Source: https://habr.com/ru/post/1761150/


All Articles