Re: escaping string in a function

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Shuying Wang <wang(dot)shuying(dot)lists(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: escaping string in a function
Date: 2006-03-02 04:25:20
Message-ID: 20060302042520.GA86664@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message George Weaver 2006-03-02 15:12:26 pg_config --pgxs
Previous Message Shuying Wang 2006-03-02 03:38:04 Re: escaping string in a function