Postgresql 9.2 reservation table contains objekt2 column whose type is char(10).
The following code is used to create non-overlapped reservations table:
CREATE TABLE reservat (
id serial primary key,
objekt2 char(10) references yksus2,
during tsrange,
rida int references rid on delete cascade not null,
EXCLUDE USING gist (objekt2 text_pattern_ops WITH =, during WITH &&)
);
This causes error:
ERROR: operator class “text_pattern_ops” does not exist for access
method “gist”
How to fix this error so that char(10) type columns can used for reservations and overlapping reservations are not allowed for same objekt2 values ?
You need to use btree_gist extension. There is an example in the docs about this: Constraints on Ranges