{
    "mode": "man",
    "parameter": "ALTER_COLLATION",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/ALTER_COLLATION/7/json",
    "generated": "2026-10-09T17:02:04Z",
    "synopsis": "ALTER COLLATION name REFRESH VERSION\nALTER COLLATION name RENAME TO newname\nALTER COLLATION name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER COLLATION name SET SCHEMA newschema",
    "sections": {
        "NAME": {
            "content": "ALTERCOLLATION - change the definition of a collation\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ALTER COLLATION name REFRESH VERSION\n\nALTER COLLATION name RENAME TO newname\nALTER COLLATION name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER COLLATION name SET SCHEMA newschema\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "ALTER COLLATION changes the definition of a collation.\n\nYou must own the collation to use ALTER COLLATION. To alter the owner, you must be able to\nSET ROLE to the new owning role, and that role must have CREATE privilege on the collation's\nschema. (These restrictions enforce that altering the owner doesn't do anything you couldn't\ndo by dropping and recreating the collation. However, a superuser can alter ownership of any\ncollation anyway.)\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "name\nThe name (optionally schema-qualified) of an existing collation.\n\nnewname\nThe new name of the collation.\n\nnewowner\nThe new owner of the collation.\n\nnewschema\nThe new schema for the collation.\n\nREFRESH VERSION\nUpdate the collation's version. See Notes below.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "When a collation object is created, the provider-specific version of the collation is\nrecorded in the system catalog. When the collation is used, the current version is checked\nagainst the recorded version, and a warning is issued when there is a mismatch, for example:\n\nWARNING:  collation \"xx-x-icu\" has version mismatch\nDETAIL:  The collation in the database was created using version 1.2.3.4, but the operating system provides version 2.3.4.5.\nHINT:  Rebuild all objects affected by this collation and run ALTER COLLATION pgcatalog.\"xx-x-icu\" REFRESH VERSION, or build PostgreSQL with the right library version.\n\nA change in collation definitions can lead to corrupt indexes and other problems because the\ndatabase system relies on stored objects having a certain sort order. Generally, this should\nbe avoided, but it can happen in legitimate circumstances, such as when upgrading the\noperating system to a new major version or when using pgupgrade to upgrade to server\nbinaries linked with a newer version of ICU. When this happens, all objects depending on the\ncollation should be rebuilt, for example, using REINDEX. When that is done, the collation\nversion can be refreshed using the command ALTER COLLATION ... REFRESH VERSION. This will\nupdate the system catalog to record the current collation version and will make the warning\ngo away. Note that this does not actually check whether all affected objects have been\nrebuilt correctly.\n\nWhen using collations provided by libc, version information is recorded on systems using the\nGNU C library (most Linux systems), FreeBSD and Windows. When using collations provided by\nICU, the version information is provided by the ICU library and is available on all\nplatforms.\n\nNote\n\nWhen using the GNU C library for collations, the C library's version is used as a proxy\nfor the collation version. Many Linux distributions change collation definitions only\nwhen upgrading the C library, but this approach is imperfect as maintainers are free to\nback-port newer collation definitions to older C library releases.\n\nWhen using Windows for collations, version information is only available for collations\ndefined with BCP 47 language tags such as en-US.\n\nFor the database default collation, there is an analogous command ALTER DATABASE ... REFRESH\nCOLLATION VERSION.\n\nThe following query can be used to identify all collations in the current database that need\nto be refreshed and the objects that depend on them:\n\nSELECT pgdescribeobject(refclassid, refobjid, refobjsubid) AS \"Collation\",\npgdescribeobject(classid, objid, objsubid) AS \"Object\"\nFROM pgdepend d JOIN pgcollation c\nON refclassid = 'pgcollation'::regclass AND refobjid = c.oid\nWHERE c.collversion <> pgcollationactualversion(c.oid)\nORDER BY 1, 2;\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To rename the collation deDE to german:\n\nALTER COLLATION \"deDE\" RENAME TO german;\n\nTo change the owner of the collation enUS to joe:\n\nALTER COLLATION \"enUS\" OWNER TO joe;\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "There is no ALTER COLLATION statement in the SQL standard.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CREATE COLLATION (CREATECOLLATION(7)), DROP COLLATION (DROPCOLLATION(7))\n\nPostgreSQL 16.14                                2026                              ALTER COLLATION(7)",
            "subsections": []
        }
    },
    "summary": "ALTERCOLLATION - change the definition of a collation",
    "flags": [],
    "examples": [
        "To rename the collation deDE to german:",
        "ALTER COLLATION \"deDE\" RENAME TO german;",
        "To change the owner of the collation enUS to joe:",
        "ALTER COLLATION \"enUS\" OWNER TO joe;"
    ],
    "see_also": [
        {
            "name": "CREATECOLLATION",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATECOLLATION/7/json"
        },
        {
            "name": "DROPCOLLATION",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/DROPCOLLATION/7/json"
        },
        {
            "name": "COLLATION",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/COLLATION/7/json"
        }
    ]
}