From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mitch Vincent <mitch@venux.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: date() indexing error..
Date: Fri, 26 May 2000 11:52:57 -0400
Message-ID: <2212.959356377@sss.pgh.pa.us> (raw)
In-Reply-To: <00a601bfc71f$05ed13c0$4100000a@venux.net>
References: <00a601bfc71f$05ed13c0$4100000a@venux.net>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, mitch@venux.net
Subject: Re: date() indexing error..
In-Reply-To: <2212.959356377@sss.pgh.pa.us>
References: <00a601bfc71f$05ed13c0$4100000a@venux.net> <2212.959356377@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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