darold / ora2pg

Ora2Pg is a free tool used to migrate an Oracle database to a PostgreSQL compatible schema. It connects your Oracle database, scan it automatically and extracts its structure or data, it then generates SQL scripts that you can load into PostgreSQL.
http://www.ora2pg.com/
GNU General Public License v3.0
991 stars 342 forks source link

Extending the enhancement in Pull Request #1621 to the Oracle_FDW use… #1633

Closed simonpane closed 1 year ago

simonpane commented 1 year ago

One final enhancement related to Issue #1381, and specifically the use of Oracle Wallets to hold the Oracle database credentials.

In this specific PR, the same functionality is extended to the Oracle_FDW user mapping. Logic of the PR suggested change is: _If the Oracle user and password directives are set to the special marker string (from the previous enhancement changes) then leave them as empty strings in the OracleFDW user mapping.

Tested this change and it works successfully as expected:

If the ORACLE_USER and the ORACLE_PWD directives are set to the special marker string in the configuration file then the Ora2Pg created user mapping will look like:

  oid  | umuser | umserver |     umoptions
-------+--------+----------+-------------------
 43010 |  30576 |    43009 | {user=,password=}

And data copy through the Oracle_FDW will work successfully, leveraging the Oracle Wallet!

But if the ORACLE_USER and the ORACLE_PWD directives are set to actual values in the configuration file, then the Ora2Pg created user mapping still works as expected (meaning in exactly the same way as before):

  oid  | umuser | umserver |          umoptions
-------+--------+----------+-----------------------------
 42756 |  30576 |    42755 | {user=SCOTT,password=******}