pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Hubert Palme <palme@uni-wuppertal.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: parse error in create index
Date: Thu, 8 Feb 2001 14:56:52 -0800 (PST)
Message-ID: <Pine.BSF.4.21.0102081456090.55852-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <14979.8207.255434.213797@palme-pc.urz.Uni-Wuppertal.DE>


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', <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!




view thread (7+ messages)  latest in thread

Message-ID: <Pine.BSF.4.21.0102081456090.55852-100000@megazone23.bigpanda.com>
Permalink:  ../Pine.BSF.4.21.0102081456090.55852-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/Pine.BSF.4.21.0102081456090.55852-100000@megazone23.bigpanda.com

 · 

reply

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: sszabo@megazone23.bigpanda.com, palme@uni-wuppertal.de
  Subject: Re: parse error in create index
  In-Reply-To: <Pine.BSF.4.21.0102081456090.55852-100000@megazone23.bigpanda.com>
  References: <14979.8207.255434.213797@palme-pc.urz.Uni-Wuppertal.DE> <Pine.BSF.4.21.0102081456090.55852-100000@megazone23.bigpanda.com>

* 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