Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puLlR-0005jX-M4 for pgsql-general@arkaria.postgresql.org; Wed, 03 May 2023 23:20:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1puLlP-0001Dk-VR for pgsql-general@arkaria.postgresql.org; Wed, 03 May 2023 23:19:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puLlP-0001Db-L9 for pgsql-general@lists.postgresql.org; Wed, 03 May 2023 23:19:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1puLlL-000Qcm-0P for pgsql-general@postgresql.org; Wed, 03 May 2023 23:19:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 343NJmPh3031534; Wed, 3 May 2023 19:19:48 -0400 From: Tom Lane To: Erik Wienhold cc: "Nagendra Mahesh (namahesh)" , "pgsql-general@postgresql.org" Subject: Re: Invoking SQL function while doing CREATE OR REPLACE on it In-reply-to: <2095430749.1191808.1683147795554@office.mailbox.org> References: <2095430749.1191808.1683147795554@office.mailbox.org> Comments: In-reply-to Erik Wienhold message dated "Wed, 03 May 2023 23:03:15 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3031532.1683155988.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 03 May 2023 19:19:48 -0400 Message-ID: <3031533.1683155988@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Erik Wienhold writes: > On 03/05/2023 20:17 CEST Nagendra Mahesh (namahesh) = wrote: >> I have a Postgres 14.4 cluster (AWS Aurora) to which I connect from my >> application using JDBC. Aurora uses, I believe, some other storage engine entirely than community Postgres has. >> Only in this tiny time window, few transactions fail with the following= error: >> ERROR: function bar(arg1 =3D> text, arg2 =3D> text) does not exist >> Hint: No function matches the given name and argument types. You might = need to add explicit type casts. > There's also a race condition bug in v14.4 that may be relevant. It got= fixed > in v14.5. See "Fix race condition when checking transaction visibility"= in > https://www.postgresql.org/docs/14/release-14-5.html. That race could easily explain this symptom: during the update, there are two versions of the function's pg_proc row, and it could be that both of them appear "dead" to an onlooker transaction if one of them is inspected during the race window. Then the onlooker would find no live version of the row and report that it doesn't exist. But having said that, it's not clear to me whether Aurora's storage engine shares this bug with community PG, or you're seeing some independent bug of theirs that happens to have a similar symptom. It's even less clear whether AWS would have applied the fix yet if it is a shared bug. You really need to discuss this with AWS support. regards, tom lane