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