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
978 stars 341 forks source link

Bug Issue migrating data in json column (like https://github.com/darold/ora2pg/issues/1745) #1772

Closed matttt55 closed 2 months ago

matttt55 commented 2 months ago

Hello,

We have the same problem than the issue https://github.com/darold/ora2pg/issues/1745 .

The https://github.com/darold/ora2pg/commit/a5ae177bded36267127d63b9064114021c617196 does not resolve this issue.

The data type json content "Inf" are still replaced by "Infinity" .

We have tested the correction in library lib/Ora2Pg.pm, and I think this problem is in the declaration of the function isnum (line 13900).

The data type "json" is not declared in the function isnum.

I tested to add this type json in the funciton and after that the result is ok. This modification resolve the problem.

In lib/Ora2Pg.pm, line 13900 : 13900 $hs->{isnum} = $data_types->[$idx] !~ /^(char|varchar|date|time|text|bytea|xml|uuid|citext)/i ? 1 :0; I test this correction , with add type json: 13900 $hs->{isnum} = $data_types->[$idx] !~ /^(json|char|varchar|date|time|text|bytea|xml|uuid|citext)/i ? 1 :0;

Can you have a look on this error/correction please ?

Regards, Mat

darold commented 2 months ago

Good catch, commit 8ba2ecc apply your patch.