0

I imported a foreign schema using IMPORT FOREIGN SCHEMA. Now I'm able to access all the table content in that schema, but still unable to access any of the functions.

Is it possible to execute a foreign function on the foreign server? With FDW or any other way.

asked Aug 10, 2022 at 10:52
1
  • FDWs only support tables (as of Postgres 14) Commented Aug 10, 2022 at 11:09

1 Answer 1

1

You can use dblink to accomplish this. Fortunately, dblink will accept the name of a foreign server in place of the connection string. Unfortunately, it does still remain a bit ugly as the return types must be specified in the query (among other ugliness):

select * from dblink('foreign_server_name', 'select foobar(42)') f(i int); 
answered Aug 10, 2022 at 16:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.