Re: parse error in create index - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: parse error in create index
Date
Msg-id Pine.BSF.4.21.0102060853160.43759-100000@megazone23.bigpanda.com
Whole thread Raw
In response to parse error in create index  (Hubert Palme <palme@uni-wuppertal.de>)
Responses Re: parse error in create index  (palme@uni-wuppertal.de (Hubert Palme))
List 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@uni-wuppertal.de
> 



pgsql-sql by date:

Previous
From: Michael Ansley
Date:
Subject: RE: PL/PGSQL function with parameters
Next
From: Josh Berkus
Date:
Subject: Re: PL/PGSQL function with parameters