Re: Is there anyway to create a functional index using to_date?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Chris Hoover <revoohc(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Is there anyway to create a functional index using to_date?
Date: 2005-08-16 21:07:01
Message-ID: 20050816210701.GB29260@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Aug 16, 2005 at 16:24:37 -0400,
Chris Hoover <revoohc(at)gmail(dot)com> wrote:
> I'm running 7.3.4 and we are having problems with our reporting views
> on our database. One fix I wanted to do was to create a functional
> index using the to_date function. However, when I do a create index
> abc on table def(to_date(char_field,'yyyymmdd')), PostgreSQL complains
> about a parser error at the 'yyyymmdd'. Is there anyway to force
> PostgreSQL to create this kind of index?
>
> I can get it to create on if I create a special function that just
> takes the field to be converted and returns the converted date.
> However, I would prefer not to go that route since it requires us to
> update all of our views.

That is what you have to do in older versions of postgres. You don't have
to do that in 8.0 (I am not sure about 7.4).

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message josh@segrestfarms.com 2005-08-16 21:09:04 SQL Help - Obtaining ID of record INSERTED
Previous Message Chris Hoover 2005-08-16 20:24:37 Is there anyway to create a functional index using to_date?