Re: Function Returning SETOF Problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Function Returning SETOF Problem
Дата
Msg-id 15705.1071709283@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Function Returning SETOF Problem  (Ron St-Pierre <rstpierre@syscor.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: restore error - language "plperlu" is not trusted
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Function Returning SETOF Problem