Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Re: PL/pgSQL: How to return two columns and multiple rows

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: PL/pgSQL: How to return two columns and multiple rows
Дата
Msg-id 20150618154942.GH133018@postgresql.org
обсуждение исходный текст
Ответ на Re: PL/pgSQL: How to return two columns and multiple rows  (Sven Geggus <lists@fuchsschwanzdomain.de>)
Список pgsql-general
Sven Geggus wrote:

> Using your suggestion the desired two columns are generated, but I consider
> this a little bit ugly:
>
> mydb=> WITH exec_func AS ( select myfunc(col1,col2) from mytable )
> SELECT (exec_func.myfunc).* FROM exec_func;
> HINWEIS:  called with parms foo,bar: text1 value1
> HINWEIS:  called with parms foo,bar: text2 value2

What's wrong with a plain subselect?

select (myfunc).* from (select myfunc(col1,col2) from mytable) f;


--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


В списке pgsql-general по дате отправления: