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

Invalid Functions counts for -t TEST , due to missing schema filter. #1747

Closed dcgadmin closed 3 months ago

dcgadmin commented 3 months ago

While performing TEST operation, on Function count we are not filtering migration schema or schema from config PG_SCHEMA in Metadata query. currently it is considering all schema in the database, if it can be filtered based on schema reporting will look appropriate.

my $schema_clause = "    AND n.nspname NOT IN ('pg_catalog','information_schema')";
    $sql = qq{
SELECT n.nspname,proname,prorettype
FROM pg_catalog.pg_proc p
     LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
     LEFT JOIN pg_catalog.pg_type t ON t.oid=p.prorettype
WHERE t.typname <> 'trigger'
     AND NOT EXISTS (SELECT 1 FROM pg_catalog.pg_depend d WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass AND d.objid = p.oid AND d.deptype = 'e')
$schema_clause
};
darold commented 3 months ago

Commit 2065dd9 fixes this issue.