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
-
postgresql_fdw doesn't talk to Oracle in the first place. What are you actually using?jjanes– jjanes2020年03月09日 14:27:14 +00:00Commented Mar 9, 2020 at 14:27
-
i use the oracle_fdw extensionMarcelS– MarcelS2020年03月09日 14:49:22 +00:00Commented 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.
answered Mar 9, 2020 at 15:22
-
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– MarcelS2020年03月10日 09:29:02 +00:00Commented Mar 10, 2020 at 9:29
-
That should work fine. Hard to tell what went wrong without knowing your schema.Laurenz Albe– Laurenz Albe2020年04月03日 19:48:28 +00:00Commented Apr 3, 2020 at 19:48
lang-sql