Liquibase® version 3.8.5 is now available! Get it for free.
2018 XML Announcement
News All Previous Posts >>

Subscribe for email updates

- and/or -

Change: ‘createSynonym’

Creates a synonym

Available Attributes

NameDescriptionRequired ForSupportsSince
objectCatalogNameall
objectNameallall
objectSchemaNameall
objectTypedb2all
privateall
replaceIfExistsall
synonymCatalogNameall
synonymNameallall
synonymSchemaNameall
<changeSet author="liquibase-docs" id="createSynonym-example">
    <pro:createSynonym objectName="A String"
            objectType="A String"
            private="true"
            replaceIfExists="false"
            synonymName="A String"/>
</changeSet>
changeSet:
  id: createSynonym-example
  author: liquibase-docs
  changes:
  - createSynonym:
      objectName: A String
      objectType: A String
      private: true
      replaceIfExists: false
      synonymName: A String
{
  "changeSet": {
    "id": "createSynonym-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "createSynonym": {
          "objectName": "A String",
          "objectType": "A String",
          "private": true,
          "replaceIfExists": false,
          "synonymName": "A String"
        }
      }]
    
  }
}

SQL Generated From Above Sample (SQL Server)

CREATE SYNONYM [A String] FOR [A String];

Database Support

DatabaseNotesAuto Rollback
DB2/LUWSupportedYes
DB2/zSupportedYes
DerbyNot SupportedYes
FirebirdNot SupportedYes
H2Not SupportedYes
HyperSQLNot SupportedYes
INGRESNot SupportedYes
InformixNot SupportedYes
MariaDBNot SupportedYes
MySQLNot SupportedYes
OracleSupportedYes
PostgreSQLNot SupportedYes
SQL ServerSupportedYes
SQLiteNot SupportedYes
SybaseNot SupportedYes
Sybase AnywhereNot SupportedYes