DROP STATISTICS

An SQL command for removing a statistics object

DROP STATISTICS is a DDL command for removing a statistics object.

DROP STATISTICS was added in PostgreSQL 10.

Change history

DROP STATISTICS has not been modified since it was added in PostgreSQL 10.

Examples

Basic usage example for DROP STATISTICS:

postgres=# DROP STATISTICS s1;
DROP STATISTICS

Safely attempting to drop a statistics object which may not exist:

postgres=# DROP STATISTICS IF EXISTS s1;
NOTICE:  statistics object "s1" does not exist, skipping

Attempting to drop a statistics object which does not exist:

postgres=# DROP STATISTICS s1;
ERROR:  statistics object "s1" does not exist

Categories

DDL, Planner, SQL command

See also

CREATE STATISTICS, ALTER STATISTICS