indexing date_part

From: "DEV" <dev(at)umpa-us(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: indexing date_part
Date: 2005-02-28 19:35:05
Message-ID: E1D5qfP-0007wl-00@umpa-us.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

I am interested in setting up an index with a date_part as part of it. From
what I have been able to find I need to write a function that will return
the date_part that I want I have tried
CREATE FUNCTION month_idxable(date) returns date AS 'SELECT
date_part('month', date) from mchistw' LANGUAGE 'SQL' WITH (iscachable);

And I get: ERROR: parser: parse error at or near "month" at character 72

So what am I doing wrong and how would I include the function into an index?

Thank you all for all of your help!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar Hafstað 2005-02-28 19:36:53 Re: Problems with pgcrypto and special characters
Previous Message Bruce Momjian 2005-02-28 18:57:23 Re: Unicode support on Win32