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.02k stars 343 forks source link

export synonyms #1043

Closed dlc75 closed 3 years ago

dlc75 commented 3 years ago

Hello,

Even if I konw that the preferred method to translate Oracle synonym is setting search_path, I detect the following problem during conversion of Oracle synonyms into PosgreSQL views

In the Oracle database

SELECT * FROM dba_synonyms WHERE table_owner='BUM_DEV_2'; OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME DB_LINK
PUBLIC TBUMT_BANDEAU BUM_DEV_2 TBUMT_BANDEAU

Script .../schema/synonyms/synonym.sql

CREATE VIEW public.public.tbumt_bandeau AS SELECT FROM bum_dev_2.tbumt_bandeau; ALTER VIEW public.public.tbumt_bandeau OWNER TO bum_dev_2; GRANT ALL ON public.public.tbumt_bandeau TO public; RATHER THAN CREATE VIEW public.tbumt_bandeau AS SELECT FROM bum_dev_2.tbumt_bandeau; ALTER VIEW public.tbumt_bandeau OWNER TO bum_dev_2; GRANT ALL ON public.tbumt_bandeau TO public;

Thanks in advance for your response

darold commented 3 years ago

Commit 0422295 fixes this issue.