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.
When I use a REPLACE_COLS directive, I've got a partial support for my column renaming on the NOT NULL constraint statement. Given the following Oracle table:
ora2pg -c config/ora2pg.conf -t TABLE -a TEST -b schema/tables -o tables.sql
-- schema/tables/table.sql
CREATE TABLE test (
id numeric(22) NOT NULL,
active varchar(1) NOT NULL DEFAULT 'N'
) ;
ALTER TABLE test ADD PRIMARY KEY (id);
ALTER TABLE test ALTER COLUMN is_active SET NOT NULL;
The PRIMARY KEY constraint statement is defined on renamed column, but NOT NULL is not.
As NOT NULL is already defined in CREATE TABLE statement, is the ALTER COLUMN SET NOT NULL statement necessary?
Hi Gilles,
Ora2Pg version: v24.1
When I use a
REPLACE_COLS
directive, I've got a partial support for my column renaming on theNOT NULL
constraint statement. Given the following Oracle table:The
PRIMARY KEY
constraint statement is defined on renamed column, butNOT NULL
is not. AsNOT NULL
is already defined inCREATE TABLE
statement, is theALTER COLUMN SET NOT NULL
statement necessary?Regards, Florent