Skip site navigation (1) Skip section navigation (2)

Re: date() indexing error..

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mitch Vincent" <mitch(at)venux(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: date() indexing error..
Date: 2000-05-26 15:52:57
Message-ID: 2212.959356377@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-sql
"Mitch Vincent" <mitch(at)venux(dot)net> writes:
> Using PostgreSQL 7.0 I'm Doing ...
> ipa2=# CREATE INDEX "app_stat_month" on applicant_stats(date(month));
> ERROR:  SQL-language function not supported in this context.

> ipa2=# \d applicant_stats
>      Table "applicant_stats"
>  Attribute |   Type    | Modifier
> -----------+-----------+----------
>  app_id    | integer   |
>  month     | date      |
>  user_id   | integer   |
>  view_time | timestamp |
> Index: app_id

Since month is already a 'date', applying date() to it is pretty pointless.

I don't really know why we have date(date) defined at all, but we do,
and it's defined as an SQL-language function --- which indexes don't
support at the moment.  Thus the error message.

There are a fair number of no-op functions in pg_proc that are defined
as SQL "SELECT $1".  We could probably afford to lose 'em all, and let
the parser treat these things as implicit type conversions instead...

			regards, tom lane

In response to

pgsql-sql by date

Next:From: Peter LandisDate: 2000-05-26 15:58:18
Subject: POSTGRESQL and PERL?
Previous:From: Mitch VincentDate: 2000-05-26 14:31:04
Subject: date() indexing error..

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group