Re: PL/pgSQL: How to return two columns and multiple rows - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: PL/pgSQL: How to return two columns and multiple rows
Date
Msg-id 20150618154942.GH133018@postgresql.org
Whole thread Raw
In response to Re: PL/pgSQL: How to return two columns and multiple rows  (Sven Geggus <lists@fuchsschwanzdomain.de>)
List 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 by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: PL/pgSQL: How to return two columns and multiple rows
Next
From: Sven Geggus
Date:
Subject: Re: PL/pgSQL: How to return two columns and multiple rows