Re: escaping string in a function - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: escaping string in a function
Date
Msg-id 20060302042520.GA86664@winnie.fuhr.org
Whole thread Raw
In response to escaping string in a function  ("Shuying Wang" <wang.shuying.lists@gmail.com>)
List pgsql-novice
On Thu, Mar 02, 2006 at 02:24:09PM +1100, Shuying Wang wrote:
> I'm trying to write a function that would the results of select 'foo'.
> How do I escape strings within a create function block?

It's not clear what you're trying to do -- could you explain a
little more?  Does the following example help?

CREATE FUNCTION func() RETURNS text AS '
  SELECT ''foo''::text
' LANGUAGE sql IMMUTABLE;

--
Michael Fuhr

pgsql-novice by date:

Previous
From: "Shuying Wang"
Date:
Subject: Re: escaping string in a function
Next
From: George Weaver
Date:
Subject: pg_config --pgxs