Foreign Data Wrapper from Oracle to Postgres 16

Started by Santhosh S10 months ago3 messagesgeneral
Jump to latest
#1Santhosh S
sansel25041991@gmail.com

Hi team,

I am working on a project along with my peers on developing an Foreign Data
Wrapper to transfer data from Oracle to Postgres 16. We followed the below
steps in order:

1. Developed the Foreign Data Wrapper (64-bit) using Microsoft Visual
Studio to transfer from Oracle to Postgres 16
2. Installed Oracle Instant Client 64-bit versionand InstantClient Path has
been set in the environment variables
3. Have Postgres 16 64-bit version installed
4. Placed all the files from each folder of the downloaded ORACLE_FDW
package should be copied into the respective folders of PostgreSQL
Installation directory
5. “oci.dll” from the Oracle Instant Client Installation directory to
PostgreSQL Installation directory
6. Visual C++ redistributable is installed

After the above steps when we try to execute the below statement in
Postgres 16

CREATE EXTENSION IF NOT EXISTS oracle_fdw
SCHEMA public
VERSION "1.2"

we get the error "SQL Error [58P01]: ERROR: could not load library
"C:/Program Files/PostgreSQL/16/lib/oracle_fdw.dll": The specified module
could not be found.
Error position"

But we are able to execute the above command successfully in Postgres 13
and successfully transfer data from Oracle to Postgres 13.

Any help or direction would be greatly helpful.

Regards
Santhosh S

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Santhosh S (#1)
Re: Foreign Data Wrapper from Oracle to Postgres 16

On Wed, 2025-07-02 at 23:58 +0530, Santhosh S wrote:

I am working on a project along with my peers on developing an Foreign Data Wrapper
to transfer data from Oracle to Postgres 16. We followed the below steps in order:

1. Developed the Foreign Data Wrapper (64-bit) using Microsoft Visual Studio to transfer from Oracle to Postgres 16
2. Installed Oracle Instant Client 64-bit versionand InstantClient Path has been set in the environment variables
3. Have Postgres 16 64-bit version installed
4. Placed all the files from each folder of the downloaded ORACLE_FDW package should
be copied into the respective folders of PostgreSQL Installation directory
5. “oci.dll” from the Oracle Instant Client Installation directory to PostgreSQL Installation directory
6. Visual C++ redistributable is installed

After the above steps when we try to execute the below statement in Postgres 16

CREATE EXTENSION IF NOT EXISTS oracle_fdw
SCHEMA public
VERSION "1.2"

we get the error "SQL Error [58P01]: ERROR: could not load library "C:/Program Files/PostgreSQL/16/lib/oracle_fdw.dll": The specified module could not be found.
Error position" 

But we are able to execute the above command successfully in Postgres 13 and successfully transfer data from Oracle to Postgres 13.

Any help or direction would be greatly helpful.

This is better tracked here: https://github.com/laurenz/oracle_fdw/issues/754

By the way, I took a double take when I read your report.
For me "developing" a FDW means writing the code, whereas you are clearly
talking about what I would call "building", "compiling" or "instaling"
the FDW. No problem, I just want to avoid confusion.

Yours,
Laurenz Albe

#3DINESH  NAIR
Dinesh_Nair@iitmpravartak.net
In reply to: Laurenz Albe (#2)
Re: Foreign Data Wrapper from Oracle to Postgres 16

Hi,

We found a link that may help resolve the issue you encountered while creating the oracle_fdw extension on windows machine.

laurenz/oracle_fdw: PostgreSQL Foreign Data Wrapper for Oracle<https://github.com/laurenz/oracle_fdw?tab=readme-ov-file#6-installation&gt;
[https://opengraph.githubassets.com/5ddf3cfa010c4132953bb148ce5b719f099b54771a4898555db8946528da016a/laurenz/oracle_fdw]&lt;https://github.com/laurenz/oracle_fdw?tab=readme-ov-file#6-installation&gt;
GitHub - laurenz/oracle_fdw: PostgreSQL Foreign Data Wrapper for Oracle<https://github.com/laurenz/oracle_fdw?tab=readme-ov-file#6-installation&gt;
PostgreSQL Foreign Data Wrapper for Oracle. Contribute to laurenz/oracle_fdw development by creating an account on GitHub.
github.com

Thanks

Dinesh Nair

________________________________
From: Laurenz Albe <laurenz.albe@cybertec.at>
Sent: Thursday, July 3, 2025 12:20 PM
To: Santhosh S <sansel25041991@gmail.com>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-novice@postgresql.org <pgsql-novice@postgresql.org>
Subject: Re: Foreign Data Wrapper from Oracle to Postgres 16

Caution: This email was sent from an external source. Please verify the sender’s identity before clicking links or opening attachments.

On Wed, 2025-07-02 at 23:58 +0530, Santhosh S wrote:

I am working on a project along with my peers on developing an Foreign Data Wrapper
to transfer data from Oracle to Postgres 16. We followed the below steps in order:

1. Developed the Foreign Data Wrapper (64-bit) using Microsoft Visual Studio to transfer from Oracle to Postgres 16
2. Installed Oracle Instant Client 64-bit versionand InstantClient Path has been set in the environment variables
3. Have Postgres 16 64-bit version installed
4. Placed all the files from each folder of the downloaded ORACLE_FDW package should
be copied into the respective folders of PostgreSQL Installation directory
5. “oci.dll” from the Oracle Instant Client Installation directory to PostgreSQL Installation directory
6. Visual C++ redistributable is installed

After the above steps when we try to execute the below statement in Postgres 16

CREATE EXTENSION IF NOT EXISTS oracle_fdw
SCHEMA public
VERSION "1.2"

we get the error "SQL Error [58P01]: ERROR: could not load library "C:/Program Files/PostgreSQL/16/lib/oracle_fdw.dll": The specified module could not be found.
Error position"

But we are able to execute the above command successfully in Postgres 13 and successfully transfer data from Oracle to Postgres 13.

Any help or direction would be greatly helpful.

This is better tracked here: https://ind01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flaurenz%2Foracle_fdw%2Fissues%2F754&amp;data=05%7C02%7Cdinesh_nair%40iitmpravartak.net%7C0b83211e99d44b76a1ce08ddba4ddf83%7C3e964837c2384683915549f4ec04f8e9%7C0%7C0%7C638871565825604004%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&amp;sdata=hwVQ5nQaRomTkOBz49RpAW4k8YA1gbmANAXRRZrFCe8%3D&amp;reserved=0&lt;https://github.com/laurenz/oracle_fdw/issues/754&gt;

By the way, I took a double take when I read your report.
For me "developing" a FDW means writing the code, whereas you are clearly
talking about what I would call "building", "compiling" or "instaling"
the FDW. No problem, I just want to avoid confusion.

Yours,
Laurenz Albe