logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

DROP_STATISTICS - remove extended statistics

Compatibility

There is no DROPSTATISTICS command in the SQL standard.

Description

DROPSTATISTICS removes statistics object(s) from the database. Only the statistics object's owner, the schema owner, or a superuser can drop a statistics object.

Examples

To destroy two statistics objects in different schemas, without failing if they don't exist: DROP STATISTICS IF EXISTS accounting.users_uid_creation, public.grants_user_role;

Name

DROP_STATISTICS - remove extended statistics

Parameters

IF EXISTS Do not throw an error if the statistics object does not exist. A notice is issued in this case. name The name (optionally schema-qualified) of the statistics object to drop. CASCADE RESTRICT These key words do not have any effect, since there are no dependencies on statistics.

See Also

ALTER STATISTICS (ALTER_STATISTICS(7)), CREATE STATISTICS (CREATE_STATISTICS(7)) PostgreSQL 17.5 2025 DROPSTATISTICS(7)

Synopsis

DROP STATISTICS [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

See Also