Re: Functional indices with const params.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Denis Perchine <dyp(at)perchine(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Functional indices with const params.
Date: 2000-08-03 15:07:56
Message-ID: 8064.965315276@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Denis Perchine <dyp(at)perchine(dot)com> writes:
> is it possible to create functional indices with constant params?

> create index ix_s_m on stats(date_part('month', sent_date));

No.

> If it is not possible is there any workarounds for this?

Sure: make your own function that does what you want with no extra
parameters. I don't think an SQL function works as an index function
right now (I may be able to fix that for 7.1, but no promises), but a
plpgsql (or pl-anything) function should work.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-08-03 15:11:48 Re: Unions in views
Previous Message Tom Lane 2000-08-03 14:56:30 Re: [HACKERS] random() function produces wrong range