Re: BUG #13799: Unexpected multiple exection of user defined function with out parameters - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #13799: Unexpected multiple exection of user defined function with out parameters
Date
Msg-id CAKFQuwauVSA9qeSvtTYE3u_tUpysTzkSML2Z8CDndt2WGWzN9g@mail.gmail.com
Whole thread Raw
In response to BUG #13799: Unexpected multiple exection of user defined function with out parameters  (mike.lang1010@gmail.com)
List pgsql-bugs
On Fri, Dec 4, 2015 at 11:36 PM, <mike.lang1010@gmail.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      13799
> Logged by:          Michael Lang
> Email address:      mike.lang1010@gmail.com
> PostgreSQL version: 9.4.5
> Operating system:   Ubuntu 12.04
> Description:
>
> Hi - it's late and I missed an typo in the previous submission of this bu=
g.
> Please discard bug #13798 in favor of this post.
> ---
>

=E2=80=8BAnswers provided on original (#13798) bug report thread.

In short:

Use LATERAL
Use CTE (i.e., WITH) if unable or undesirable to use LATERAL=E2=80=8B

=E2=80=8BUsing FROM works as long as you don't need to pass in parameters f=
rom
other relations.  Typically this problem occurs when you do which is why
putting the function call into the SELECT list happens in the first place.=
=E2=80=8B

David J.

pgsql-bugs by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: BUG #13803: too many clients exception
Next
From: Tom Lane
Date:
Subject: Re: BUG #13796: ALTER TYPE DROP COLUMN -- unexpected behavior ?