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 1nrn40-0005qB-6U for pgsql-bugs@arkaria.postgresql.org; Thu, 19 May 2022 20:48:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nrn3y-0006JG-74 for pgsql-bugs@arkaria.postgresql.org; Thu, 19 May 2022 20:48:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrn3x-0006J6-Up for pgsql-bugs@lists.postgresql.org; Thu, 19 May 2022 20:48:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrn3v-0003Rt-3Z for pgsql-bugs@lists.postgresql.org; Thu, 19 May 2022 20:48:00 +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 24JKluRZ206111; Thu, 19 May 2022 16:47:56 -0400 From: Tom Lane To: kravtsov.k@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17487: Parallel execution fails when original user is removed In-reply-to: <17487-b44f2aa8ab499e20@postgresql.org> References: <17487-b44f2aa8ab499e20@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 19 May 2022 18:46:41 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <206109.1652993276.1@sss.pgh.pa.us> Date: Thu, 19 May 2022 16:47:56 -0400 Message-ID: <206110.1652993276@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > We're using temporary credentials to access the DB. The temporary > credentials are granted a role and automatically become that role on > connect. As soon as temporary credential is removed while the connection is > still alive, any regular query would continue to work, however, a parallel > query would cause an error: > ERROR: role with OID XXXXXX does not exist > CONTEXT: parallel worker I don't think this is particularly a bug. You are relying on an undocumented and un-guaranteed implementation artifact that it's possible to drop a role at all while it's still in use in some session. If we were to make any effort in this area, the end result would certainly be that the DROP ROLE would be rejected, not that the parallel query case would start to work. One reason why we'd want to go in that direction is that there are almost certainly many other cases where such an "orphaned" session misbehaves. (Doing that has in fact been discussed, but nothing's been done about it so far AFAIK.) regards, tom lane