Re: problems with single quotes.. - Mailing list pgsql-sql

From Luis Miguel Castañeda
Subject Re: problems with single quotes..
Date
Msg-id B0001893457@correoserver.interlink.es
Whole thread Raw
In response to Re: problems with single quotes..  ("Megalex" <megalex@klanomega.com>)
List 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@nova.es
_________________________________________________________________
I've lost my faith in nihilism


pgsql-sql by date:

Previous
From: tjennette@thomasnelson.com (Trace)
Date:
Subject: SQL Joins
Next
From: CoL
Date:
Subject: Re: Error trying to create a functional index.