Re: How to fix set-valued function called in context that cannot accept a set in earlier versions

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Andrus <kobruleht2(at)hot(dot)ee>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to fix set-valued function called in context that cannot accept a set in earlier versions
Date: 2010-04-05 14:30:21
Message-ID: 20100405143021.GA31050@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 05, 2010 at 05:26:39PM +0300, Andrus wrote:
> Thank you.
>
>> another workaround is to wrap the pl/pgsql function in sql function.
>> it's not always easy to re-work the function all into a 'from'
>> expression.
>
> I tried code below in 8.3 but got error
> CREATE OR REPLACE FUNCTION wordwrap83(line text, linelen integer)
> RETURNS SETOF text as $$
> BEGIN
> select * from wordwrap(line,linelen);
> END
> $$ LANGUAGE sql;

remove begin and end from above function.

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
jid/gtalk: depesz(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2010-04-05 14:33:59 Re: How to fix set-valued function called in contextthat cannot accept a set in earlier versions
Previous Message Andrus 2010-04-05 14:26:39 Re: How to fix set-valued function called in context that cannot accept a set in earlier versions