Posted by haki 1/20/2026
The article suggests using a check constraint to get around that - are you saying that does actually check the underlying value when USING HASH is set? If so, I think the docs need updating.
Of course the hash index also outperforms a unique (btree) index on top of separately calculating the hash, in addition to the storage overhead, row bloat, lack of guarantees regarding the hash unless you expose it to Postgres as a user-defined function AND add a check constraint.
Is the syntax highlighting built into pgsql now or is that some other wrapper that provides that? (it looks really nice).
My only gripe with it is its insistence on adding a space after a line break when the query is too long, making copy/paste a pain for long queries.