CREATE SYNONYM v14
CREATE SYNONYM -- define a new synonym.
CREATE SYNONYM defines a synonym for certain types of database objects. EDB Postgres Advanced Server supports synonyms for:
- materialized views
- stored procedures
- stored functions
- objects that are accessible through a database link
- other 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 don't 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.
dblink_name specifies the name of the database link through which an object is accessed.
REPLACE clause to replace an existing synonym definition with a new synonym definition.
PUBLIC clause to create the synonym in the
public schema. The
CREATE PUBLIC SYNONYM command, compatible with Oracle databases, creates a synonym that resides in the
This just a shorthand way to write:
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,