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

DISABLE_PARTITION is ignored while creating indexes #1647

Closed pavel-moskotin-db closed 11 months ago

pavel-moskotin-db commented 1 year ago

In ora2pg:23.2, DISABLE_PARTITION 1

for table partitioned by range, like

--ORACLE
CREATE TABLE TABLE_A
   (    "ID" NUMBER NOT NULL ENABLE, 
    "CREATED_TIMESTAMP" TIMESTAMP (6) NOT NULL ENABLE, 
     CONSTRAINT "PK_TABLE_A" PRIMARY KEY ("ID")
   ) 
  PARTITION BY RANGE ("CREATED_TIMESTAMP") INTERVAL (NUMTODSINTERVAL(1, 'DAY'))

data is copied in non-partitioned manner, but PK is unexpectedly converted to

-- Postgres
CONSTRAINT "PK_TABLE_A" PRIMARY KEY ("ID", "CREATED_TIMESTAMP")

Expectation would be that PK is converted without changes if DISABLE_PARTITION setting is set.

darold commented 11 months ago

Thanks for the report, commit 5b5e4f8 fixes this issue.