Equivalent to exclusion constraint composed of integer and range

后端 未结 1 1784
野趣味
野趣味 2020-12-20 03:24

I need to have something equivalent to this exclusion constraint

drop table if exists t;
create table t (
    i int,
    tsr tstzrange,
    excl         


        
相关标签:
1条回答
  • 2020-12-20 04:05

    You need to install the additional module btree_gist to make it work. The module installs the missing operator class.

    Details in this related answer:
    Exclusion constraint on a bitstring column with bitwise AND operator

    More at this answer on dba.SE:
    PostgreSQL EXCLUDE USING error: Data type integer has no default operator class

    0 讨论(0)
提交回复
热议问题