DROP CLUSTERING KEY

DROP CLUSTERING KEY drops all clustering keys in a table.

Read our CLUSTER BY guide for more information.

See also CREATE TABLE

Syntax

ALTER TABLE [schema_name.]table_name DROP CLUSTERING KEY

table_name ::= identifier

Parameters

Parameter

Description

schema_name

The schema name for the table. Defaults to public if not specified

table_name

The table name to apply the change to

Usage notes

  • Removing clustering keys does not affect existing data

  • To force data to re-cluster, the table has to be recreated (i.e. with CREATE TABLE AS)

Examples

Dropping Clustering Keys in a Table

ALTER TABLE
  public.users DROP CLUSTERING KEY

Permissions

The role must have the DDL permission at the database or table level.