All Products
Search
Document Center

PolarDB:DROP SYNONYM

Last Updated:Mar 28, 2026

Deletes a synonym from the database.

Prerequisites

Before you drop a synonym, ensure that you have:

  • Ownership of the synonym

  • The USAGE privilege on the schema where the synonym resides

Syntax

DROP [PUBLIC] SYNONYM [schema.]syn_name

Parameters

ParameterDescription
PUBLICDrops a synonym that resides in the public schema.
schemaThe schema that contains the synonym.
syn_nameThe name of the synonym to drop. Synonym names must be unique within a schema.

Usage notes

Schema resolution without a qualifier

If two synonyms with the same name exist in your search path, PolarDB for PostgreSQL (Compatible with Oracle) drops the first one found. To target a specific synonym, qualify its name with a schema:

DROP SYNONYM myschema.personnel;

Dropping a public synonym

Use DROP PUBLIC SYNONYM to drop a synonym in the public schema. The schema qualifier is not allowed with PUBLIC:

DROP PUBLIC SYNONYM personnel;

Examples

The following example drops the personnel synonym:

DROP SYNONYM personnel;

What's next