From: Hubert Palme <palme@uni-wuppertal.de>
To: pgsql-sql@postgresql.org
Subject: Re: parse error in create index
Date: Thu, 08 Feb 2001 23:29:31 +0100
Message-ID: <3A831DCB.A377361C@uni-wuppertal.de> (raw)
References: <Pine.BSF.4.21.0102060853160.43759-100000@megazone23.bigpanda.com>
Stephan Szabo wrote:
>
> 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.
Hmm... Perhaps, it's better I post to the novice group, because I'm new
to SQL.
Anyway -- That's my trial:
adressen=> CREATE FUNCTION geb_monat (date) RETURNS integer AS
adressen-> 'SELECT date_part('month', $1)::integer;'
adressen-> LANGUAGE 'sql';
ERROR: parser: parse error at or near "month"
The point are the nested strings, I guess. How can I render a "'" in an
SQL string?
Thanks for your help!
--
Hubert Palme
palme@uni-wuppertal.de
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: palme@uni-wuppertal.de
Subject: Re: parse error in create index
In-Reply-To: <3A831DCB.A377361C@uni-wuppertal.de>
References: <Pine.BSF.4.21.0102060853160.43759-100000@megazone23.bigpanda.com> <3A831DCB.A377361C@uni-wuppertal.de>
* 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