On Fri, Dec 4, 2015 at 11:30 PM, <mike.lang1010@gmail.com> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 13798
> Logged by: Michael Lang
> Email address: mike.lang1010@gmail.com
> PostgreSQL version: 9.4.5
> Operating system: Ubuntu 12.04
> Description:
>
> I've found that when a user defined function has
> out parameters, it is invoked once per out parameter if invoked with the
> syntax:
>
> `SELECT (udf()).*`
>
> Is this the expected behavior?
=E2=80=8BYes, it is.
Using the recently introduced "LATERAL" feature is the preferred method.
=E2=80=8B(i think...)=E2=80=8B
=E2=80=8BSELECT *=E2=80=8B
=E2=80=8BFROM src
LATERAL func_call(src.col);=E2=80=8B
If that is not possible you can use a CTE.
WITH func_cte AS (
SELECT function_call(...) --do not expand this yet; pass it out as a
composite
)
SELECT (func_cte.function_call).* --now we expand the composite; not the
unusual parens - they are required.
FROM func_cte;
David J.