Skip to content

ERROR access method "hash" does not support unique indexes #50

@froque

Description

@froque

Create rule to check this error earlier:

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

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions