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 1smz4T-000DYN-Iu for pgsql-bugs@arkaria.postgresql.org; Sat, 07 Sep 2024 17:18:02 +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 1smz3U-001O7s-UU for pgsql-bugs@arkaria.postgresql.org; Sat, 07 Sep 2024 17:17:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smz3U-001O7j-GB for pgsql-bugs@lists.postgresql.org; Sat, 07 Sep 2024 17:17:00 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smz3N-00014N-Os for pgsql-bugs@lists.postgresql.org; Sat, 07 Sep 2024 17:16: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 487HGpej2514771; Sat, 7 Sep 2024 13:16:51 -0400 From: Tom Lane To: Basha cc: Joe Conway , Christophe Pettus , PostgreSQL Bug List Subject: Re: [EXT]: Re: BUG #18604: Regression in PostgreSQL 16.4: pg_dump Prevents Essential System Table Modifications In-reply-to: References: <18604-04d64b68e981ced6@postgresql.org> <3B462E2E-88B6-43B9-943F-90E883D33357@thebuild.com> <183A6734-06B2-48E9-A5C9-235EF87B0DFB@thebuild.com> <6860E1BC-DA5A-4576-9FB6-35ED31E6F017@thebuild.com> <73AD2F56-1009-49C7-8752-39C45325A9BB@thebuild.com> <01CF2C94-D153-4687-B2EF-EF4B4B1890DF@thebuild.com> <2410942.1725675471@sss.pgh.pa.us> <8D1E6C08-1C4B-4056-846F-C33C0056249E@thebuild.com> <172a934d-6a5d-4c57-9935-43862025b842@joeconway.com> <2503009.1725722934@sss.pgh.pa.us> Comments: In-reply-to Basha message dated "Sat, 07 Sep 2024 16:03:37 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2514769.1725729411.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 07 Sep 2024 13:16:51 -0400 Message-ID: <2514770.1725729411@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Basha writes: > As suggested, tried creating the below RLS policy on the pg_database tab= le. But seems it does not check for the connect permission. [ pokes around... ] Ah indeed, because check_enable_rls has a hard-wired assumption that no built-in table has any RLS: /* Nothing to do for built-in relations */ if (relid < (Oid) FirstNormalObjectId) return RLS_NONE; I wonder if we should remove that? It's only saving one syscache lookup (and if we were hot about that, most of the callers have an open Relation that could be passed). I did check that this policy works as-expected if that test is deleted. Still, making such a change would amount to actively supporting RLS on catalogs, rather than just a laissez-faire "you can use it if it works" approach. I'm not convinced we want to go there, because for a lot of the catalogs there are going to be additional access pathways such as I mentioned for roles. I do not want to buy into those things becoming arguable security bugs. And I *definitely* don't want to try to close off system accesses to catalogs based on RLS. regards, tom lane