Re: Problem using set-returning functions
От | Tom Lane |
---|---|
Тема | Re: Problem using set-returning functions |
Дата | |
Msg-id | 14736.1143474510@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Problem using set-returning functions (Markus Schaber <schabi@logix-tt.com>) |
Список | pgsql-sql |
Markus Schaber <schabi@logix-tt.com> writes: > navteq=# select foo,generate_x(bar) from test; > ERROR: set-valued function called in context that cannot accept a set > CONTEXT: PL/pgSQL function "generate_x" line 5 at return next plpgsql SRFs don't support being called from the SELECT target list, only from a FROM-expression. Your other function is probably written in SQL not plpgsql; SQL functions do support this. plpgsql could probably be fixed if we were really motivated to do so, but I think most people who have looked at it feel we should phase out the capability to call SRFs from a target list, rather than extend it. It's weird and not very semantically sound --- in particular, there's no very sensible definition if there's more than one of them in the target list. See past discussions in the PG archives. regards, tom lane
В списке pgsql-sql по дате отправления: