0

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.

jjanes
42.4k3 gold badges44 silver badges54 bronze badges
asked Mar 9, 2020 at 13:39
2
  • postgresql_fdw doesn't talk to Oracle in the first place. What are you actually using? Commented Mar 9, 2020 at 14:27
  • i use the oracle_fdw extension Commented Mar 9, 2020 at 14:49

1 Answer 1

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.

answered Mar 9, 2020 at 15:22
2
  • 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; Commented Mar 10, 2020 at 9:29
  • That should work fine. Hard to tell what went wrong without knowing your schema. Commented Apr 3, 2020 at 19:48

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.