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
1.01k stars 342 forks source link

Naming tables that contain dollars #1563

Closed yano-rxa closed 1 year ago

yano-rxa commented 1 year ago

1461

Mr.Darold

Thank you for the community's correspondence to this issue. We confirmed the fix status in V23.2. A table of name containing "$" was created from a general user as follows and tried to convert using V23.2. As a result, table of name containing "$" could not be converted.

Table creation:

CREATE TABLE AQ$test ( empno VARCHAR2(10) NOT NULL, empname VARCHAR2(50), gender_f NUMBER(1,0) ) ;

CREATE TABLE BIN$test ( empno VARCHAR2(10) NOT NULL, empname VARCHAR2(50), gender_f NUMBER(1,0) ) ;

Execution Result:

ora2pg -c ora2pg.conf -o pg_table.sql -t table

[========================>] 0/0 tables (100.0%) end of scanning. [========================>] 0/0 tables (100.0%) end of table export. Oracle does not prohibit the use of "$" as the distinguished name of a table created by ordinary users. In addition, we have faced a case where a customer is using an object containing a "$".

We think it would be better to make it convertible even if a table containing special characters such as "$" is defined by a general user.

Therefore, after judging system user and general user, we want to modify it to convert user-defined table.

The execution result should be as follows.

Execution Result:

ora2pg -c ora2pg.conf -o pg_table.sql -t table

[========================>] 2/2 tables (100.0%) end of scanning. [========================>] 2/2 tables (100.0%) end of table export.

yano-rxa commented 1 year ago

Mr.Darold

What do you think about this?

Looking forward to your reply.

thanks

mkgrgis commented 1 year ago

@yano-rxa, there is also problem with "." in names of tables and columns, see https://github.com/darold/ora2pg/issues/1567.

bharanisvng commented 1 year ago

1461

Mr.Darold

Thank you for the community's correspondence to this issue. We confirmed the fix status in V23.2. A table of name containing "$" was created from a general user as follows and tried to convert using V23.2. As a result, table of name containing "$" could not be converted.

Table creation:

CREATE TABLE AQ$test ( empno VARCHAR2(10) NOT NULL, empname VARCHAR2(50), gender_f NUMBER(1,0) ) ;

CREATE TABLE BIN$test ( empno VARCHAR2(10) NOT NULL, empname VARCHAR2(50), gender_f NUMBER(1,0) ) ;

Execution Result:

ora2pg -c ora2pg.conf -o pg_table.sql -t table

[========================>] 0/0 tables (100.0%) end of scanning. [========================>] 0/0 tables (100.0%) end of table export. Oracle does not prohibit the use of "$" as the distinguished name of a table created by ordinary users. In addition, we have faced a case where a customer is using an object containing a "$".

We think it would be better to make it convertible even if a table containing special characters such as "$" is defined by a general user.

Therefore, after judging system user and general user, we want to modify it to convert user-defined table.

The execution result should be as follows.

Execution Result:

ora2pg -c ora2pg.conf -o pg_table.sql -t table

[========================>] 2/2 tables (100.0%) end of scanning. [========================>] 2/2 tables (100.0%) end of table export. Tagged with issue # 1593 problem too exists for a sequence name having special character $ in it using ora2pg Ver 23.X e.g We recently upgraded to ora2pg Ver 23.2. we noticed issue with the column name (table or sequence or index name) having special character as "$" in their name

With the older version of ora2pg , it got converted without any issues.

We faced issued in the conversion of a Sequence name having " $" in their name. CREATE SEQUENCE "public"."bsv_ISEQ$$_25269" MINVALUE 1 MAXVALUE XXXX INCREMENT BY 1 START WITH 142 ;

darold commented 1 year ago

This have been fixed.