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 1ofNlB-0003wg-VT for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Oct 2022 15:53:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ofNlA-0005Z8-NA for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Oct 2022 15:53:36 +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 1ofNlA-0005Yz-FR for pgsql-bugs@lists.postgresql.org; Mon, 03 Oct 2022 15:53:36 +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 1ofNl7-0003ea-Dk for pgsql-bugs@lists.postgresql.org; Mon, 03 Oct 2022 15:53:35 +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 293FrVuN1515821; Mon, 3 Oct 2022 11:53:31 -0400 From: Tom Lane To: "David G. Johnston" cc: loren@paradigm.xyz, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17626: Permission denied errors should list role as well as user In-reply-to: References: <17626-644f053cc20e1ba3@postgresql.org> <1425128.1664805055@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Mon, 03 Oct 2022 08:40:05 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1515819.1664812411.1@sss.pgh.pa.us> Date: Mon, 03 Oct 2022 11:53:31 -0400 Message-ID: <1515820.1664812411@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > Basically, a permission check requires two things and the complaint is that > only one of those things is mentioned in the error message. No, the complaint is that the wrong thing is shown --- but I don't know what's showing it; aclcheck_error() certainly doesn't. There's a separate conversation to be had perhaps about whether aclcheck_error's standard message *should* include the role name whose permissions were checked. I have a vague feeling that that omission was intentional, but it was so long ago that I don't recall for sure. It seems like something that'd be good to show in more complicated situations with views, security definer functions, etc. regards, tom lane