Skip to content

ERROR: access method "hash" does not support unique indexesΒ #706

@froque

Description

@froque

squawk could check for index types for unique indexes

postgres@localhost postgres=# create table foo (id int); 
CREATE TABLE
postgres@localhost postgres=# create unique index concurrently if not exists idx_foo_id_hash on foo using hash(id);
ERROR:  access method "hash" does not support unique indexes
postgres@localhost postgres=# create table points(p point); 
CREATE TABLE
postgres@localhost postgres=# create unique index concurrently if not exists idx_points_p_gist on points using gist(p);  
ERROR:  access method "gist" does not support unique indexes

Currently, only B-tree indexes can be declared unique.
https://www.postgresql.org/docs/18/indexes-unique.html

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions