Re: parse error in create index

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Hubert Palme <palme(at)uni-wuppertal(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: parse error in create index
Date: 2001-02-06 16:54:30
Message-ID: Pine.BSF.4.21.0102060853160.43759-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Functional indexes cannot currently take constant values to the function,
so it's complaining about the constant 'month'. The current workaround is
probably to create a function that does the date_part('month', <arg>) for
you and then use that function in the index creation.

On Sat, 3 Feb 2001, Hubert Palme wrote:

> Hi,
>
> could someone, please, explain me the following parse error?
>
> adressen=> \d geburtstage
> Table = geburtstage
> +----------------------------------+----------------------------------+-------+
> | Field | Type |
> Length|
> +----------------------------------+----------------------------------+-------+
> | lfd_nr | int4
> | 4 |
> | geburtstag | date
> | 4 |
> +----------------------------------+----------------------------------+-------+
> adressen=> create index Monat_Tag on geburtstage (date_part('month',
> Geburtstag));
> ERROR: parser: parse error at or near "'"
> adressen=>
>
> Thanks in advance,
>
> --
> Hubert Palme
> palme(at)uni-wuppertal(dot)de
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-02-06 17:45:58 Re: [SQL] PL/PGSQL function with parameters
Previous Message Michael Ansley 2001-02-06 16:27:56 RE: [SQL] PL/PGSQL function with parameters