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) This code has worked up till now and works on the dev server. The expectation being that if ekey=0 the lateral join will be ignored. However on the new QA server this is hit and miss. It fails many times as it seems to ignore the shortcut
even though ekey is 0. We can make it work by doing this: 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? Zahir Lalani 151 Rosebery Avenue London EC1R 4AB t: +44 (0)7956 455 168 Thank you for your email. For a faster response please take note of the below:
For all other requests I will try and respond as soon as I can. Please note our response SLA’s
|