EXLCUDE constraints and Hash indexes - Mailing list pgsql-hackers

From Jeff Janes
Subject EXLCUDE constraints and Hash indexes
Date
Msg-id CAMkU=1z2K1G=MOyKxB8zfn0MHm_Eu-SGBiUmej460VzU=S8EiQ@mail.gmail.com
Whole thread Raw
Responses Re: EXLCUDE constraints and Hash indexes  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
From: https://www.postgresql.org/docs/9.4/static/sql-createtable.html

"The access method must support amgettuple (see Chapter 55); at
present this means GIN cannot be used. Although it's allowed, there is
little point in using B-tree or hash indexes with an exclusion
constraint, because this does nothing that an ordinary unique
constraint doesn't do better. So in practice the access method will
always be GiST or SP-GiST."

This is misleading.  Hash indexes do not support unique constraints
directly, but do support them via the EXCLUDE syntax using "WITH =".
This is nice if you want a unique index on something that might
occasionally exceed 1/3 of 8kB (titin, I'm looking at you)

Trivial doc patch attached.

Cheers,

Jeff

Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Declarative partitioning - another take
Next
From: Andrew Borodin
Date:
Subject: Re: WIP: Covering + unique indexes.