From: Ron Johnson <ronljohnsonjr@gmail.com>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Odd Shortcut behaviour in PG14
Date: Thu, 23 Nov 2023 14:32:13 -0500
Message-ID: <CANzqJaCUroe03WUn1gdGK334ivyYPus338CfvMsBknudWGqFpg@mail.gmail.com> (raw)
In-Reply-To: <DB9P251MB0546E102DB0B567C40205976A7B9A@DB9P251MB0546.EURP251.PROD.OUTLOOK.COM>
References: <DB9P251MB0546E102DB0B567C40205976A7B9A@DB9P251MB0546.EURP251.PROD.OUTLOOK.COM>
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 <ZahirLalani@oliver.agency>
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 this case the shortcut processing seems
> broken.
>
>
>
> Here is the code in question:
>
>
>
> LEFT JOIN lateral (
>
> SELECT
>
> CASE WHEN (ekey > 0) THEN convert_from(crypto_secretbox_open,
> 'utf8')::JSON ELSE NULL END AS edata
>
> FROM crypto_secretbox_open(
>
> sc.data,
>
> sc.nonce,
>
> boxkey)
>
> ) *enc ON true and (ekey > 0)*
>
>
>
> [snip]
>
> LEFT JOIN lateral (
>
> SELECT
>
> CASE WHEN (ekey > 0) THEN convert_from(crypto_secretbox_open,
> 'utf8')::JSON ELSE NULL END AS edata
>
> FROM crypto_secretbox_open(
>
> sc.data,
>
> sc.nonce,
>
> boxkey)
>
> *) enc ON (ekey > 0) and true*
>
>
>
> This should theoretically be no different – but it solves the issue 100%.
> Any guidance on why this would be the case?
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: Odd Shortcut behaviour in PG14
In-Reply-To: <CANzqJaCUroe03WUn1gdGK334ivyYPus338CfvMsBknudWGqFpg@mail.gmail.com>
References: <DB9P251MB0546E102DB0B567C40205976A7B9A@DB9P251MB0546.EURP251.PROD.OUTLOOK.COM> <CANzqJaCUroe03WUn1gdGK334ivyYPus338CfvMsBknudWGqFpg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox