Re: [SQL] Functional Indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bryan White" <bryan(at)arcamax(dot)com>
Cc: pgsql-sql(at)hub(dot)org, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [SQL] Functional Indexes
Date: 1999-02-06 17:27:47
Message-ID: 20086.918322067@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

"Bryan White" <bryan(at)arcamax(dot)com> writes:
> The documentation for CREATE INDEX implies that functions are allowed in
> index definitions but when I execute:
> create unique index idxtest on customer (lower(email));
> the result is:
> ERROR: DefineIndex: (null) class not found
> Should this work? Do I have the syntax wrong?

I tried this wih 6.4.2 and found that it was only accepted if I
explicitly identified which index operator class to use:

play=> create table customer (email text);
CREATE
play=> create unique index idxtest on customer (lower(email));
ERROR: DefineIndex: class not found
play=> create unique index idxtest on customer (lower(email) text_ops);
CREATE
play=>

That'll do as a workaround for Bryan, but isn't this a bug? Surely
the system ought to know what type the result of lower() is...

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-02-06 17:28:16 Re: [HACKERS] strange behaviour on pooled alloc
Previous Message Tom Lane 1999-02-06 17:06:54 Re: [HACKERS] Optimizer speed and GEQO (was: nested loops in joins)

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 1999-02-06 17:39:54 Re: [SQL] Function returning multiple rows?
Previous Message Sascha Schumann 1999-02-06 12:49:34 Re: [SQL] index on aggregate function