Re: ERROR: query has no destination for result data

From: Craig Ringer <craig(at)2ndQuadrant(dot)com>
To: Peter Kroon <plakroon(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: query has no destination for result data
Date: 2012-11-23 10:56:34
Message-ID: 50AF5662.2080402@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/23/2012 06:53 PM, Peter Kroon wrote:
> When using:
> RETURN QUERY(
> SELECT 'this is text'
> );
>
> I get another error:
> ERROR: cannot use RETURN QUERY in a non-SETOF function

Use a plain SQL function instead of PL/PgSQL, or use `SELECT INTO` and
ordinary `RETURN`.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2012-11-23 10:58:35 Re: ERROR: query has no destination for result data
Previous Message Peter Kroon 2012-11-23 10:54:49 Re: ERROR: query has no destination for result data