Received: from megazone23.bigpanda.com (rfx-64-6-210-138.users.reflexcom.com [64.6.210.138]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f18Mv1x09248 for ; Thu, 8 Feb 2001 17:57:02 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: from localhost (sszabo@localhost) by megazone23.bigpanda.com (8.11.2/8.11.2) with ESMTP id f18MuqL55867; Thu, 8 Feb 2001 14:56:52 -0800 (PST) Date: Thu, 8 Feb 2001 14:56:52 -0800 (PST) From: Stephan Szabo To: Hubert Palme cc: pgsql-sql@postgresql.org Subject: Re: parse error in create index In-Reply-To: <14979.8207.255434.213797@palme-pc.urz.Uni-Wuppertal.DE> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200102/169 X-Sequence-Number: 1355 You can use two quote characters to get a single quote in the quoted string, so ''month'' On Thu, 8 Feb 2001, Hubert Palme wrote: > 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!