Re: record to columns: syntax question and strange behaviour - Mailing list pgsql-sql

From Marc Mamin
Subject Re: record to columns: syntax question and strange behaviour
Date
Msg-id C4DAC901169B624F933534A26ED7DF311F9CD2@JENMAIL01.ad.intershop.net
Whole thread Raw
In response to record to columns: syntax question and strange behaviour  ("Marc Mamin" <M.Mamin@intershop.de>)
List pgsql-sql
<br /><p><font size="2">Hello,<br /><br /> Your proposal unfortunately does not work if you try to query more than one
valueand want additional columns in the results,<br /> like in<br /><br /> select column1,test(column1) FROM
(values(1),(2))foo<br /><br /> cheers,<br /><br /> Marc Mamin<br /><br /><br /> >IMO easiest would be to include a  
RETURNSSETOF record   in the<br /> >function declaration and a   return next;   statement in the function<br />
>body.E.g.<br /> ><br /> ><br /> >CREATE OR REPLACE FUNCTION test (In a int, OUT b int, OUT c int)<br />
>RETURNSSETOF record<br /> >AS<br /> >$BODY$<br /> >BEGIN<br /> >   b:=a+1;<br /> >   c:=a+2;<br />
>  return next;<br /> >END<br /> >$BODY$<br /> >   LANGUAGE 'plpgsql'<br /> ><br /> >and then
issue<br/> ><br /> >SELECT * FROM test(1);<br /><br /></font> 

pgsql-sql by date:

Previous
From: Thomas Pundt
Date:
Subject: Re: record to columns: syntax question and strange behaviour
Next
From: Bryce Nesbitt
Date:
Subject: pg_restore "WARNING: errors ignored on restore"