Re: Bug #620: create index ... (date_part('year', d)) fails

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Bug #620: create index ... (date_part('year', d)) fails
Дата
Msg-id 20020315082549.D50245-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Bug #620: create index ... (date_part('year', d)) fails  (pgsql-bugs@postgresql.org)
Список pgsql-bugs
sszabo@bigpanda.com

On Fri, 15 Mar 2002 pgsql-bugs@postgresql.org wrote:

> Ernst Molitor (molitor@uni-bonn.de) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> create index ... (date_part('year', d)) fails
>
> Long Description
> IMHO, creation of an index on a part of a date field should work,
> but it fails due to the definition of "create index ..." in gram.y.
>
> Maybe I'm wrong, but I feel that for large tables which will have to
> be analyzed per year, an index of this kind could be an advantage.

You need to make a function that is marked iscachable that returns
date_part('year', <argument>) and use that.  IIRC, functional indices
require that all of the arguments be column references.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Bug #619: Not possible to specify foreign key name
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #621: why postgreSQL stored databases in digital filenames?