Error during creation of indexes

Started by Florian Steffenover 25 years ago2 messagesgeneral
Jump to latest
#1Florian Steffen
fsteffen@urbanet.ch

Hello,

I tried to execute the following statements:

CREATE TABLE events (name NAME, description TEXT, date TINTERVAL);
CREATE INDEX events_date_idx ON events (date);

The first statement is executed without any problem, but when I'm running the
second one, I've got the following message:

ERROR: DefineIndex: type tinterval has no default operator class

What does that mean ? I would use an index to speed up queries to find all
events in a specified period of time, e.g. SELECT * FROM events WHERE date &&
('2000-12-20' <#> '2000-12-30');

Can anybody help me ? Thanks in advance,

Florian

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Florian Steffen (#1)
Re: Error during creation of indexes

Florian Steffen <fsteffen@urbanet.ch> writes:

CREATE TABLE events (name NAME, description TEXT, date TINTERVAL);
CREATE INDEX events_date_idx ON events (date);
ERROR: DefineIndex: type tinterval has no default operator class

What does that mean ?

It means there's no support for indexes on tinterval.

tinterval is an obsolete, deprecated datatype; try interval instead.

regards, tom lane