pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
date() indexing error..
2+ messages / 2 participants
[nested] [flat]

* date() indexing error..
@ 2000-05-26 14:31 Mitch Vincent <mitch@venux.net>
  2000-05-26 15:52 ` Re: date() indexing error.. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Mitch Vincent @ 2000-05-26 14:31 UTC (permalink / raw)
  To: pgsql-sql

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

When I try and do the above there is one record in the database.

ipa2=# select * from applicant_stats;
 app_id |   month    | user_id |          view_time
--------+------------+---------+------------------------------
  56941 | 05-26-2000 |     291 | Fri May 26 09:19:41 2000 EDT
(1 row)


If I erase it I get the same error, only when I try and insert data into the
table..

I'm doing these kind of indexes on several tables, this is the only one I'm
having this occur.. Any ideas?

Thanks!

-Mitch




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: date() indexing error..
  2000-05-26 14:31 date() indexing error.. Mitch Vincent <mitch@venux.net>
@ 2000-05-26 15:52 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2000-05-26 15:52 UTC (permalink / raw)
  To: Mitch Vincent <mitch@venux.net>; +Cc: pgsql-sql

"Mitch Vincent" <mitch@venux.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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-05-26 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-05-26 14:31 date() indexing error.. Mitch Vincent <mitch@venux.net>
2000-05-26 15:52 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox