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

From: Sven Geggus <lists(at)fuchsschwanzdomain(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PL/pgSQL: How to return two columns and multiple rows
Date: 2015-06-18 13:52:02
Message-ID: mluie2$vns$3@solar.geggus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Raymond O'Donnell <rod(at)iol(dot)ie> wrote:

>> mydb=> select myfunc('foo','bar');
>
> You need to do:
>
> select * from myfunc('foo','bar');

This has been a misguided example. Reality should more likely look like this:

select myfunc(col1,col2) from mytable;

And it would of course be undesired if myfunc would be called twice per row.
So how would this look like to avoid the function beeing called twice?

Regards

Sven

--
"Der wichtigste Aspekt, den Sie vor der Entscheidung für ein Open
Source-Betriebssystem bedenken sollten, ist, dass Sie kein
Windows-Betriebssystem erhalten." (von http://www.dell.de/ubuntu)
/me is giggls(at)ircnet, http://sven.gegg.us/ on the Web

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2015-06-18 13:56:30 Re: PL/pgSQL: How to return two columns and multiple rows
Previous Message Sven Geggus 2015-06-18 13:47:31 Re: PL/pgSQL: How to return two columns and multiple rows