need to create couple of foreign tables with a lot of columns from oracle. I dont want to specify all cloumns by myself. Is there a way to do something like this:

create foreign table ALFSTK **(*)** SERVER server1 options (schema 'test', table 'ALFSTK');

Or is this not possible with fdw?

Thanks for your advices.

  • postgresql_fdw doesn't talk to Oracle in the first place. What are you actually using?
    – jjanes
    Mar 9, 2020 at 14:27
  • i use the oracle_fdw extension
    – MarcelS
    Mar 9, 2020 at 14:49

1 Answer 1


This is what IMPORT FOREIGN SCHEMA is for. You can run it for a single table at a time if you want to.

oracle_fdw says it supports IMPORT FOREIGN SCHEMA, but be sure to read that section of the docs for more info.

  • thanks for this advice. I also tried this... get message "import foreign schema" but no table is importet. \dt shows no relations. My command: "import foreign schema "GISRO" limit to (LASTEN) from server server1 into cabs;
    – MarcelS
    Mar 10, 2020 at 9:29
  • That should work fine. Hard to tell what went wrong without knowing your schema. Apr 3, 2020 at 19:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.