Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f1CEw1x07790 for ; Mon, 12 Feb 2001 09:58:01 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f18N0Tx10138 for ; Thu, 8 Feb 2001 18:00:29 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f18Mn4110050 for pgsql-sql@postgresql.org; Thu, 8 Feb 2001 17:49:04 -0500 (EST) (envelope-from news) From: Hubert Palme X-Newsgroups: comp.databases.postgresql.sql Subject: Re: parse error in create index Date: Thu, 08 Feb 2001 23:29:31 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 26 Message-ID: <3A831DCB.A377361C@uni-wuppertal.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.17 i586) X-Accept-Language: de, en To: pgsql-sql@postgresql.org X-Archive-Number: 200102/203 X-Sequence-Number: 1390 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', ) 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