Search code examples
sqlpostgresqlplpgsqldblink

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 )


Solution

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