All the oracle client library and FDW extention is in the sdk bacause is not possbile to get it through wget from Oracle site. If you need another version download it from Oracle site an put it into sdk folder.
docker build -t postgres-ora-fdw:11.4 .| Arg | default |
|---|---|
| postgres_version | 11.4 |
| oracle_fdw_version | 2_1_0 |
| instantclient_version | 19_3 |
Example
docker build --build-arg postgres_version=10.4 -t postgres-ora-fdw:10.4 .docker run -d --name test-postgres postgres-ora-fdw:11.4
Enter into container
docker exec -it test-postgres bashthen
psqlthen create the extension and the connection to remote DB
CREATE EXTENSION oracle_fdw; CREATE SERVER oradb FOREIGN DATA WRAPPER oracle_fdw OPTIONS (dbserver '//<host>:1521/<database>'); GRANT USAGE ON FOREIGN SERVER oradb TO postgres; CREATE USER MAPPING FOR postgres SERVER oradb OPTIONS (user 'user', password 'password');then import table (this is like creating a symbolic link to remote database, no data is imported)
IMPORT FOREIGN SCHEMA "<foreignSchemaName>" FROM SERVER oradb INTO <localSchemaName>;more info on PostgreSQL docs.