ALTER STATISTICS
ALTER STATISTICS — change the definition of an extended statistics object
Synopsis
ALTER STATISTICSnameOWNER TO {new_owner| CURRENT_ROLE | CURRENT_USER | SESSION_USER }ALTER STATISTICSnameRENAME TOnew_nameALTER STATISTICSnameSET SCHEMAnew_schemaALTER STATISTICSnameSET STATISTICSnew_target
Description
ALTER STATISTICS changes the parameters of an existing extended statistics object. Any parameters not specifically set in theALTER STATISTICS command retain their prior settings.
You must own the statistics object to useALTER STATISTICS. To change a statistics object's schema, you must also haveCREATE privilege on the new schema. To alter the owner, you must also be a direct or indirect member of the new owning role, and that role must haveCREATE privilege on the statistics object's schema. (These restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the statistics object. However, a superuser can alter ownership of any statistics object anyway.)
Parameters
nameThe name (optionally schema-qualified) of the statistics object to be altered.
new_ownerThe user name of the new owner of the statistics object.
new_nameThe new name for the statistics object.
new_schemaThe new schema for the statistics object.
new_targetThe statistic-gathering target for this statistics object for subsequent
ANALYZEoperations. The target can be set in the range 0 to 10000; alternatively, set it to -1 to revert to using the maximum of the statistics target of the referenced columns, if set, or the system default statistics target (default_statistics_target). For more information on the use of statistics by thePostgreSQL query planner, refer toSection 14.2.
Compatibility
There is noALTER STATISTICS command in the SQL standard.