{
    "content": [
        {
            "type": "text",
            "text": "# ALTER_STATISTICS (man)\n\n## NAME\n\nALTERSTATISTICS - change the definition of an extended statistics object\n\n## SYNOPSIS\n\nALTER STATISTICS name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER STATISTICS name RENAME TO newname\nALTER STATISTICS name SET SCHEMA newschema\nALTER STATISTICS name SET STATISTICS newtarget\n\n## DESCRIPTION\n\nALTER STATISTICS changes the parameters of an existing extended statistics object. Any\nparameters not specifically set in the ALTER STATISTICS command retain their prior settings.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PARAMETERS**\n- **COMPATIBILITY**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "ALTER_STATISTICS",
        "section": "",
        "mode": "man",
        "summary": "ALTERSTATISTICS - change the definition of an extended statistics object",
        "synopsis": "ALTER STATISTICS name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER STATISTICS name RENAME TO newname\nALTER STATISTICS name SET SCHEMA newschema\nALTER STATISTICS name SET STATISTICS newtarget",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "CREATESTATISTICS",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/CREATESTATISTICS/7/json"
            },
            {
                "name": "DROPSTATISTICS",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/DROPSTATISTICS/7/json"
            },
            {
                "name": "STATISTICS",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/STATISTICS/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "ALTERSTATISTICS - change the definition of an extended statistics object\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "ALTER STATISTICS name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER STATISTICS name RENAME TO newname\nALTER STATISTICS name SET SCHEMA newschema\nALTER STATISTICS name SET STATISTICS newtarget\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "ALTER STATISTICS changes the parameters of an existing extended statistics object. Any\nparameters not specifically set in the ALTER STATISTICS command retain their prior settings.\n\nYou must own the statistics object to use ALTER STATISTICS. To change a statistics object's\nschema, you must also have CREATE privilege on the new schema. To alter the owner, you must\nalso be a direct or indirect member of the new owning role, and that role must have CREATE\nprivilege on the statistics object's schema. (These restrictions enforce that altering the\nowner doesn't do anything you couldn't do by dropping and recreating the statistics object.\nHowever, a superuser can alter ownership of any statistics object anyway.)\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "name\nThe name (optionally schema-qualified) of the statistics object to be altered.\n\nnewowner\nThe user name of the new owner of the statistics object.\n\nnewname\nThe new name for the statistics object.\n\nnewschema\nThe new schema for the statistics object.\n\nnewtarget\nThe statistic-gathering target for this statistics object for subsequent ANALYZE\noperations. The target can be set in the range 0 to 10000; alternatively, set it to -1 to\nrevert to using the maximum of the statistics target of the referenced columns, if set,\nor the system default statistics target (defaultstatisticstarget). For more information\non the use of statistics by the PostgreSQL query planner, refer to Section 14.2.\n",
                "subsections": []
            },
            "COMPATIBILITY": {
                "content": "There is no ALTER STATISTICS command in the SQL standard.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "CREATE STATISTICS (CREATESTATISTICS(7)), DROP STATISTICS (DROPSTATISTICS(7))\n\n\n\nPostgreSQL 14.23                                2026                             ALTER STATISTICS(7)",
                "subsections": []
            }
        }
    }
}