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 1ofLqX-0006Xj-Nz for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Oct 2022 13:51: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 1ofLqW-0000Q4-JR for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Oct 2022 13:51:00 +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 1ofLqW-0000Ph-Bv for pgsql-bugs@lists.postgresql.org; Mon, 03 Oct 2022 13:51:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ofLqT-0002qS-D3 for pgsql-bugs@lists.postgresql.org; Mon, 03 Oct 2022 13:50: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 293DotCn1425129; Mon, 3 Oct 2022 09:50:55 -0400 From: Tom Lane To: loren@paradigm.xyz cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17626: Permission denied errors should list role as well as user In-reply-to: <17626-644f053cc20e1ba3@postgresql.org> References: <17626-644f053cc20e1ba3@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sat, 01 Oct 2022 21:09:54 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1425127.1664805055.1@sss.pgh.pa.us> Date: Mon, 03 Oct 2022 09:50:55 -0400 Message-ID: <1425128.1664805055@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: > I'm running this set of commands: > create user elevated_user IN ROLE pg_read_all_data; > create user regular_user; > create table foo (id int); > set role elevated_user; > select * from foo; -- works > set role regular_user; > select * from foo; -- errors > The error message looks like "user=elevated_user ERROR: permission denied > for table foo". No ... it just looks like regression=> select * from foo; -- errors ERROR: permission denied for table foo I don't know where "user=elevated_user" is coming from in your environment, but it seems like it must be from client-side code that's not tracking the active role correctly. regards, tom lane