Updated November, 23 2023

Synonyms#

In PostgreSQL there is no direct analogue of Oracle’s synonym. So we just store the synonym name and its reference object to a table dbt.synonyms, and substitute the synonym name in SQL to a referenced object.

OracleDB

1--Oracle
2CREATE SYNONYM countries FOR hr.countries;
3/
4SELECT * FROM countries;
5/
6DROP SYNONYM countries;
7/