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.
After some poking around I realised that the partition type is not defined at the point the oracle_fdw table is defined in the following:
my $fdw_definition = $self->export_table();
My initial attempt to resolve the false warning involved moving the above code to after the partitioning type has been obtained. That resulted in Ora2Pg attempting to create a foreign table with a "PARTITION BY" clause, which is not valid and therefore errors.
It seems the most appropriate approach is to disable the partitioning via disable_partition while populating fdw_definition and then set disable_partition back to its original value, so that's what I've implemented in the commit for this pull request.
I've run a range of tests in an attempt to validate that I've not broken something unexpected. However, my understanding of the code is very limited at this point so please review the approach and modify/reject the pull request as appropriate.
Using Ora2Pg COPY with oracle_fdw on a partitioned table results in the following message:
Looking into the code I found that "WARNING: unsupported partition type" is only raised in the following block:
After some poking around I realised that the partition type is not defined at the point the oracle_fdw table is defined in the following:
My initial attempt to resolve the false warning involved moving the above code to after the partitioning type has been obtained. That resulted in Ora2Pg attempting to create a foreign table with a "PARTITION BY" clause, which is not valid and therefore errors.
It seems the most appropriate approach is to disable the partitioning via
disable_partition
while populatingfdw_definition
and then setdisable_partition
back to its original value, so that's what I've implemented in the commit for this pull request.I've run a range of tests in an attempt to validate that I've not broken something unexpected. However, my understanding of the code is very limited at this point so please review the approach and modify/reject the pull request as appropriate.