RE: Odd Shortcut behaviour in PG14

2023-11-25 Thread Zahir Lalani
> -Original Message- > From: Tom Lane > Sent: Friday, November 24, 2023 6:44 PM > To: Zahir Lalani > Cc: Ron Johnson ; pgsql- > generallists.postgresql.org > Subject: Re: Odd Shortcut behaviour in PG14 > > OK, so if this is a plpgsql function and ekey

Re: Odd Shortcut behaviour in PG14

2023-11-24 Thread Tom Lane
Zahir Lalani writes: > Sorry Tom - let me try and clarify: > (ekey is a variable passed into the function) OK, so if this is a plpgsql function and ekey is a function variable, the planner will definitely perceive this as a query parameterized by the value of "ekey". We will consider a "custom"

RE: Odd Shortcut behaviour in PG14

2023-11-24 Thread Zahir Lalani
> -Original Message- > From: Tom Lane > Sent: Friday, November 24, 2023 3:35 PM > To: Zahir Lalani > Cc: Ron Johnson ; pgsql- > generallists.postgresql.org > Subject: Re: Odd Shortcut behaviour in PG14 > You *still* haven't defined what you mean b

Re: Odd Shortcut behaviour in PG14

2023-11-24 Thread Tom Lane
Zahir Lalani writes: > Looking at the application logs this function is being called once per > display row - it is running successfully around 10 times with the same > input params. When it fails, it is with the same params! You *still* haven't defined what you mean by "fails". We can't help yo

Re: Odd Shortcut behaviour in PG14

2023-11-24 Thread Ron Johnson
On Fri, Nov 24, 2023 at 8:01 AM Zahir Lalani wrote: > > > > -Original Message- > > From: Tom Lane > > Sent: Thursday, November 23, 2023 7:45 PM > > To: Ron Johnson > > Cc: pgsql-generallists.postgresql.org < > pgsql-general@lists.postgresql.or

RE: Odd Shortcut behaviour in PG14

2023-11-24 Thread Zahir Lalani
> -Original Message- > From: Tom Lane > Sent: Thursday, November 23, 2023 7:45 PM > To: Ron Johnson > Cc: pgsql-generallists.postgresql.org > Subject: Re: Odd Shortcut behaviour in PG14 > > Ron Johnson writes: > > Out of curiosity, what is the point

Re: Odd Shortcut behaviour in PG14

2023-11-23 Thread Tom Lane
Ron Johnson writes: > Out of curiosity, what is the point of adding the "true" predicate no > matter the position? Maybe I've created an incorrect truth table, but > "true AND" (and "AND true") don't make any logical difference when added > to (ekey > 0)*.* Not only does it not make any logical

Re: Odd Shortcut behaviour in PG14

2023-11-23 Thread Ron Johnson
Out of curiosity, what is the point of adding the "true" predicate no matter the position? Maybe I've created an incorrect truth table, but "true AND" (and "AND true") don't make any logical difference when added to (ekey > 0)*.* On Thu, Nov 23, 2023 at 11:56 AM Zahir Lalani wrote: > Hello all

Re: Odd Shortcut behaviour in PG14

2023-11-23 Thread David G. Johnston
On Thursday, November 23, 2023, Tom Lane wrote: > "David G. Johnston" writes: > > On Thursday, November 23, 2023, Tom Lane wrote: > >> This question is unanswerable as given. You have not even defined > >> what you mean by "fail" (error? wrong query result?), let alone > >> provided enough det

Re: Odd Shortcut behaviour in PG14

2023-11-23 Thread Tom Lane
"David G. Johnston" writes: > On Thursday, November 23, 2023, Tom Lane wrote: >> This question is unanswerable as given. You have not even defined >> what you mean by "fail" (error? wrong query result?), let alone >> provided enough detail for someone else to reproduce the problem. > The OP com

Re: Odd Shortcut behaviour in PG14

2023-11-23 Thread Tom Lane
Zahir Lalani writes: > Got a really weird problem with shortcut processing on one server. This question is unanswerable as given. You have not even defined what you mean by "fail" (error? wrong query result?), let alone provided enough detail for someone else to reproduce the problem.

Re: Odd Shortcut behaviour in PG14

2023-11-23 Thread Adrian Klaver
On 11/23/23 08:55, Zahir Lalani wrote: Hello all Got a really weird problem with shortcut processing on one server. We have just upgraded to PG14 from PG11. The following code works as expected on our primary Dev server, and we recently upgraded our QA server to the same level. However in thi