Postgres Plus Advanced Server Oracle Compatibility Developer's Guide :
CREATE SYNONYM -- define a new synonym
CREATE SYNONYM defines a synonym for certain types of database objects. Postgres Plus Advanced Server supports synonyms for:
● stored procedures
● stored functions
● other synonyms
A synonym is an alternate name that refers to a database object. See Section 2.2.4 for additional information on synonyms.
syn_name is the name of the synonym. A synonym name must be unique within a schema.
schema specifies the name of the schema that the synonym resides in. If you do not specify a schema name, the synonym is created in the first existing schema in your search path.
object_name specifies the name of the object.
object_schema specifies the name of the schema that the referenced object resides in.
Include the REPLACE clause to replace an existing synonym definition with a new synonym definition.
Include the PUBLIC clause to create the synonym in the public schema. The Oracle-compatible CREATE PUBLIC SYNONYM command creates a synonym that resides in the public schema:
CREATE [OR REPLACE] PUBLIC SYNONYM syn_name FOR object_schema.object_name;
This just a shorthand way to write:
CREATE [OR REPLACE] SYNONYM public.syn_name FOR object_schema.object_name;
Access to the object referenced by the synonym is determined by the permissions of the current user of the synonym; the synonym user must have the appropriate permissions on the underlying database object.
Create a synonym for the emp table in a schema named, enterprisedb: