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 343 forks source link

When generating the statement 'ALTER TABLE $table ALTER COLUMN $col SET NOT NULL', $col should be double quoted if it's a reserved keyword #1678

Closed leonteq-reisg closed 1 year ago

leonteq-reisg commented 1 year ago

https://github.com/darold/ora2pg/blob/190db1322877303051144411239e1ccb13c35379/lib/Ora2Pg.pm#L11034

We receive the following error:

13:26:37  psql:schema/tables/CONSTRAINTS_table.sql:461: ERROR:  syntax error at or near "USER"
13:26:37  LINE 1: ALTER TABLE [...] ALTER COLUMN USER SET NO...
13:26:37                                                           ^
13:26:37  ERROR: can not import constraints.
darold commented 1 year ago

Fixed