Ispirer Website Ispirer Capabilities: PostgreSQL Migration Free Trial

Synonyms Conversion from Oracle to PostgreSQL

Since the PostgreSQL doesn't support the synonyms the migration of synonyms from Oracle to PostgreSQL could have several approches:

  • using of synonyms in the code could be replaced by using of the objects directly referred to by these synonyms;
  • converting the synonyms using view (this solution will only work for table and view synonyms).

To convert synonyms in our tool you can use the following conversion options:

  1. By default, our tool does not convert synonyms. This means that when converting, all synonyms will be lost, and the use of synonyms in the code will be replaced by the use of the objects directly referred to by these synonyms. Thus, there will be no problems when creating other objects and calling them, since synonyms will not be used anywhere else in the code. This is the default approach, which allows you to easily convert all objects, excluding synonyms from the database.
  2. Sometimes users want to store the presence of synonyms in the database. For example, if their application uses these synonyms, and the client does not want to rewrite the application heavily when migrating the database. Our tool has a solution that convert synonyms to views. This solution will only work for table and view synonyms.

To convert such synonyms using view, you need to use the option:
[DDL]

SYNONYM_TO_VIEW=Yes

More details on how to set the option can be found in the How to Set Options in SQLWays Wizard article.

If this option is used, instead of synonyms for tables and views, PostgreSQL will create views for the corresponding objects:

ORACLE POSTGRESQL
CREATE SYNONYM SYN_FOR_TAB FOR TAB_FOR_SYN CREATE VIEW SYN_FOR_TAB AS SELECT * FROM TAB_FOR_SYN

For other types of objects (functions, procedures, etc.), during migration, synonyms will be skipped and the code will change the use of synonyms to the objects themselves.


If you have any other questions regarding the usage of our tool, please, contact our support team: support@ispirer.com