Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uNCEQ-00E1XA-Ue for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jun 2025 15:10:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uNCEO-00AP8Y-Vc for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jun 2025 15:10:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uNCEO-00AP8P-M7 for pgsql-hackers@lists.postgresql.org; Thu, 05 Jun 2025 15:10:13 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uNCEN-000NX8-0p for pgsql-hackers@lists.postgresql.org; Thu, 05 Jun 2025 15:10:12 +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 555FA4BP1283938; Thu, 5 Jun 2025 11:10:04 -0400 From: Tom Lane To: Noah Misch cc: Laurenz Albe , Pavel Stehule , pgsql-hackers@lists.postgresql.org Subject: Re: Wrong security context for deferred triggers? In-reply-to: <20250415155850.9b.nmisch@google.com> References: <66021ca9d81c4e1a22b6c417659b05424e130f27.camel@cybertec.at> <6bca669972ef0d4a665fa83c5b751ab116324f8f.camel@cybertec.at> <2653121.1730737337@sss.pgh.pa.us> <51386e72c47d922ef68eaa67451a52dc3f569843.camel@cybertec.at> <3944969.1737570355@sss.pgh.pa.us> <3e4c8fe7adce2e3956e01bae8f1754830bd2d2bf.camel@cybertec.at> <201480.1737653448@sss.pgh.pa.us> <67338f5d321ae6a4bae646e04b9fe0a1f27dd27c.camel@cybertec.at> <20250415155850.9b.nmisch@google.com> Comments: In-reply-to Noah Misch message dated "Tue, 15 Apr 2025 08:58:50 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1283936.1749136204.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 05 Jun 2025 11:10:04 -0400 Message-ID: <1283937.1749136204@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Noah Misch writes: > commit 01463e1 wrote: >> +NOTICE: I am regress_groot > Let's not incur trivially-avoidable trademark risks > (https://google.com/search?q=3D%22i+am+groot%22) in the source tree. Good point, done. > Phrase "the role that executed the statement" doesn't match what happens= if > the role changes mid-statement. Example of a statement that does so: > select set_config('role', rolname, true), current_user from pg_authid; > The term "security context" doesn't otherwise appear in doc/. I would j= ust > change "run in the security context of the role" to "run as the role". = That's > simpler and less likely to create an impression that this stops attacks. I don't mind s/in the security context of/as/, but not sure if we need to do more here. Changing role mid-query seems sufficiently unusual that we'd probably just confuse people by mentioning the case. Unless you have a proposed wording you think is better? regards, tom lane