Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filenames created incorrectly when exporting using the COPY option and parameter RENAME_PARTITION=1 #1800

Open
simonpane opened this issue Jul 10, 2024 · 0 comments

Comments

@simonpane
Copy link
Contributor

Exporting from Oracle to disk using the command:

ora2pg -t COPY -o data.sql -b ./data -c ./config/ora2pg.conf

Export includes a PARTITIONED table and consequently am including the Ora2Pg configuration parameter:

RENAME_PARTITION               1

After exporting, the data/data.sql file uses the renamed partitions. Excerpt for example:

...
\i './data/SAMPLE_TABLE_data.sql'
\i './data/SAMPLE_TABLE_part1_data.sql'
\i './data/SAMPLE_TABLE_part2_data.sql'
\i './data/SAMPLE_TABLE_part3_data.sql'
\i './data/SAMPLE_TABLE_part4_data.sql'
...

But the actual files on disk do not use the new names, and instead use the old partition names in the filename. Example:

ls -1 data/SAMPLE_TABLE*
SAMPLE_TABLE_data.sql
SAMPLE_TABLE_SYS_P72925_data.sql
SAMPLE_TABLE_SYS_P72926_data.sql
SAMPLE_TABLE_SYS_P72927_data.sql
SAMPLE_TABLE_SYS_P72929_data.sql

And consequently, when running import_all.sh the script will fail as it cannot find the properly named files on disk.


Even if exporting partitions with RENAME_PARTITION=0 and using the COPY option to export to disk (and not to write directly into the PostgreSQL target), the exported files have an incorrect file name as they include the table name while the data/data.sql references to those files do not.


Ora2Pg version:

$ ora2pg --version
Ora2Pg v24.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant