title: PostgreSQL OK to use HASH exclude constraint for uniqueness?
body: <p>Since hashes are smaller than lengthy text, it seems to me that they could be preferred to b-trees for ensuring column uniqueness.</p>
  
  <p>For the sole purpose of ensuring uniqueness, is there any reason the following isn't OK in PG 10?</p>
  
  <pre><code>CREATE TABLE test (
    path ltree,
    EXCLUDE USING HASH ((path::text) WITH =)
  );
  </code></pre>
  
  <p>I assume hash collisions are internally dealt with. Would be useless otherwise.</p>
  
  <p>I will use a <code>GiST</code> index for query enhancement.</p>