{
    "mode": "man",
    "parameter": "ALTER_RULE",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/ALTER_RULE/7/json",
    "generated": "2026-06-15T13:13:36Z",
    "synopsis": "ALTER RULE name ON tablename RENAME TO newname",
    "sections": {
        "NAME": {
            "content": "ALTERRULE - change the definition of a rule\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ALTER RULE name ON tablename RENAME TO newname\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "ALTER RULE changes properties of an existing rule. Currently, the only available action is to\nchange the rule's name.\n\nTo use ALTER RULE, you must own the table or view that the rule applies to.\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "name\nThe name of an existing rule to alter.\n\ntablename\nThe name (optionally schema-qualified) of the table or view that the rule applies to.\n\nnewname\nThe new name for the rule.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To rename an existing rule:\n\nALTER RULE notifyall ON emp RENAME TO notifyme;\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "ALTER RULE is a PostgreSQL language extension, as is the entire query rewrite system.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CREATE RULE (CREATERULE(7)), DROP RULE (DROPRULE(7))\n\n\n\nPostgreSQL 14.23                                2026                                   ALTER RULE(7)",
            "subsections": []
        }
    },
    "summary": "ALTERRULE - change the definition of a rule",
    "flags": [],
    "examples": [
        "To rename an existing rule:",
        "ALTER RULE notifyall ON emp RENAME TO notifyme;"
    ],
    "see_also": [
        {
            "name": "CREATERULE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATERULE/7/json"
        },
        {
            "name": "DROPRULE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/DROPRULE/7/json"
        },
        {
            "name": "RULE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/RULE/7/json"
        }
    ]
}