Search code examples
sqlpostgresqlplpgsql

Is there a workaround to importing foreign schema's functions in postgres


My use case is that I would like to use a function from one database server into a schema of the DB i am operating in. From it looks like, foreign data wrapper only supports importing tables and when I do-

IMPORT FOREIGN SCHEMA foreign_schema FROM SERVER foreign_server INTO temp_schema

I don't really see the functions getting imported.

Is there a way I could get the functions imported as well? or am I out of luck?


Solution

  • You can use dblink for this, to execute any piece of SQL on the remote server, including function calls.