| From: | Remigiusz Sokolowski <rems(at)gdansk(dot)sprint(dot)pl> |
|---|---|
| To: | Sascha Schumann <sas(at)schell(dot)de> |
| Cc: | pgsql-sql(at)hub(dot)org |
| Subject: | Re: [SQL] index on aggregate function |
| Date: | 1999-02-15 07:57:26 |
| Message-ID: | Pine.GS4.4.02A.9902150853400.16896-100000@netra.gdansk.sprint.pl |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
> > > I somewhere read that it is possible to create an index on aggregate functions
> > > in PostgreSQL. Which syntax do I have to use for it?
> > >
> > > test=> CREATE TABLE test ( name VARCHAR(32) );
> > > CREATE
> > > test=> CREATE INDEX test_idx ON test lower(name);
> > > ERROR: parser: parse error at or near "lower"
> > >
> > > gives me a parser error.
> >
> > Right syntax is
> > CREATE INDEX test_idx ON test (lower(name) text_ops);
> > I try it and index was generated without error
> > Rem
>
> Well, that exact statement gives me:
>
> ERROR: BuildFuncTupleDesc: function 'lower(varchar)' does not exist
>
> I also tried varchar_ops and char_ops instead of text_ops, but that does not
> resolve the problem. I'm using PostgreSQL 6.4.2 on Linux without problems so
> far.
I have holidays and now have to read so much mails, that I can't find if
there were any other suggestions about that. AFAIK there is no lower()
function for varchar type and this is a problem - solution is to use text
type or create function lower() for varchar type.
Rem
-------------------------------------------------------------------*------------
Remigiusz Sokolowski e-mail: rems(at)gdansk(dot)sprint(dot)pl * *
-----------------------------------------------------------------*****----------
| From | Date | Subject | |
|---|---|---|---|
| Next Message | J. Kinsley | 1999-02-15 09:01:28 | ENUM Type |
| Previous Message | Tom Lane | 1999-02-14 18:38:41 | Re: Moving Database -> New Disk |