Re: problems with single quotes..

From: Luis Miguel Castañeda <lmc(at)interlink(dot)es>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: problems with single quotes..
Date: 2002-01-08 00:21:58
Message-ID: B0001893457@correoserver.interlink.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

El Thursday 04 January 2001 08:50, Megalex escribió:

> i already tried escaping it.. but the problem is
> with the singlequote-backslash-singlequote combinations..

I use something like this, and works fine for me:

create function quote(text)
   returns text
   as '
   DECLARE
        quote text;
   BEGIN
        quote := ichar(39); -- quote
        return quote  || $1 || quote;
   END;'
   language 'plpgsql';

--
Saludos, lmc(at)nova(dot)es
_________________________________________________________________
I've lost my faith in nihilism

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-01-08 00:26:31 Re: SELECT * FROM xy WHERE name LIKE '%german special char'
Previous Message Manuel Sugawara 2002-01-08 00:06:52 Re: SELECT * FROM xy WHERE name LIKE '%german special char'