I have a table like
my_type | text
my_box | box
where my_box
is of type box
from the geometric types, and not from postgis.
I want a way to ensure that there are no duplicate boxes across all values of my_type
. Usually, if it were an integer or somesuch, I'd just create a unique index across both columns. However, when trying to create an index on a box, I get
data type box has no default operator class for access method "btree"
HINT: You must specify an operator class for the index or define a default operator class for the data type.
Can I specify an operator class for the index? Do I cast the box as something else? (I'd like this solution to also apply to polygon
, if possible) Do I create a function index?
Note that this is specifically NOT having to do with PostGis (unless that's the only way to do this - I'm not even sure if PostGis applies to geometric types). That's all that comes up when I google this, though.