table of contents
ALTER STATISTICS(7) | PostgreSQL 16.4 Documentation | ALTER STATISTICS(7) |
NAME¶
ALTER_STATISTICS - change the definition of an extended statistics object
SYNOPSIS¶
ALTER STATISTICS name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER } ALTER STATISTICS name RENAME TO new_name ALTER STATISTICS name SET SCHEMA new_schema ALTER STATISTICS name SET STATISTICS new_target
DESCRIPTION¶
ALTER STATISTICS changes the parameters of an existing extended statistics object. Any parameters not specifically set in the ALTER STATISTICS command retain their prior settings.
You must own the statistics object to use ALTER STATISTICS. To change a statistics object's schema, you must also have CREATE privilege on the new schema. To alter the owner, you must be able to SET ROLE to the new owning role, and that role must have CREATE 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¶
name
new_owner
new_name
new_schema
new_target
COMPATIBILITY¶
There is no ALTER STATISTICS command in the SQL standard.
SEE ALSO¶
CREATE STATISTICS (CREATE_STATISTICS(7)), DROP STATISTICS (DROP_STATISTICS(7))
2024 | PostgreSQL 16.4 |