Re: Function Returning SETOF Problem - Mailing list pgsql-general

From Tom Lane
Subject Re: Function Returning SETOF Problem
Date
Msg-id 15705.1071709283@sss.pgh.pa.us
Whole thread Raw
In response to Function Returning SETOF Problem  (Ron St-Pierre <rstpierre@syscor.com>)
List pgsql-general
Ron St-Pierre <rstpierre@syscor.com> writes:
> On a daily basis I place a lot of data into the empty table dailyList,
> and from that data update certain fields in currentList. I thought that
> using a function would be a good way to do this(?). However I get the
> following error when I run updateCurrentData():
>    ERROR:  set-valued function called in context that cannot accept a set

You're probably doing
    SELECT updateCurrentData();
where you should be doing
    SELECT * FROM updateCurrentData();

There are some cases where you can invoke set-valued functions in the
target list rather than in the FROM list, but this isn't one of 'em.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: restore error - language "plperlu" is not trusted
Next
From: Stephan Szabo
Date:
Subject: Re: Function Returning SETOF Problem