default operator class (PostgreSQL's error?) - Mailing list pgsql-sql

From Denis Zaitsev
Subject default operator class (PostgreSQL's error?)
Date
Msg-id 20030302142401.B4208@natasha.zzz.zzz
Whole thread Raw
Responses Re: default operator class (PostgreSQL's error?)
List pgsql-sql
I create a scalar type name_t.  Then I define the operator class for
it:

create operator class name_ops   default for type name_t   using btree as       operator 1 <,       operator 2 <=,
operator 3 =,       operator 4 >=,       operator 5 >,       function 1 name_cmp (name_t,name_t);
 

And it is DEFAULT for the type.  Then I create some table:

create table name_l (   name name_t       unique       not null,   key smallint       primary key,   sex sex
);

And the UNIQUE constraint leads to the next error:

ERROR:  data type name_t has no default operator class for access method "btree"       You must specify an operator
classfor the index or define a       default operator class for the data type
 

(There is no (of course?) such an error if I not use the UNIQUE
constraint).  So, does this mean that it's an error in PostreSQL or it
is my fail thru some way?

Thanks in advance.


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: OUTER JOIN with filter
Next
From: Achilleus Mantzios
Date:
Subject: Re: Dynamic SELECT condition