squawk
squawk copied to clipboard
ERROR: access method "hash" does not support unique indexes
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
Yeah I think this makes sense to include, I wonder if we need more semantic info, like checking that hash refers to the actual postgres hash or if going off syntax is good enough.