Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j46hq-0002rf-Bm for pgsql-general@arkaria.postgresql.org; Tue, 18 Feb 2020 17:30:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j46hp-0008CZ-3z for pgsql-general@arkaria.postgresql.org; Tue, 18 Feb 2020 17:30:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j46ho-0008CS-Mf for pgsql-general@lists.postgresql.org; Tue, 18 Feb 2020 17:30:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j46hi-0002IB-7p for pgsql-general@postgresql.org; Tue, 18 Feb 2020 17:30:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 01IHUZg5006569; Tue, 18 Feb 2020 12:30:35 -0500 From: Tom Lane To: Marc Munro cc: pgsql-general@postgresql.org Subject: Re: policies and extensions In-reply-to: <1582044786.18009.20.camel@bloodnok.com> References: <1581979568.18009.18.camel@bloodnok.com> <679.1581997707@sss.pgh.pa.us> <1582044786.18009.20.camel@bloodnok.com> Comments: In-reply-to Marc Munro message dated "Tue, 18 Feb 2020 08:53:06 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <6567.1582047035.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 18 Feb 2020 12:30:35 -0500 Message-ID: <6568.1582047035@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Marc Munro writes: > On Mon, 2020-02-17 at 22:48 -0500, Tom Lane wrote: >> An RLS policy is a table "subsidiary object" so it only depends indirectly >> on the extension that owns the table. > Yep, I get that, and I see the dependency chain in the catalog.  > However an extension can create the table with or without the policy, > and a table created by an extension without policy can later have a > policy added, and, unless I'm missing something, the same dependency > chain exists in either case. > This means that I cannot tell whether the policy was added by the > extension or not. I can't get very excited about that, since the same argument could be made about triggers, indexes, or rules attached to a table, but no one has yet complained about those cases. It's fairly hard to see the use-case where it matters, anyway. If you're attaching policies to tables owned by an extension after-the-fact, you're modifying the definition of an extension-owned object, which is at best really poor practice. We say up-front that you cannot expect the extension mechanism to track the effects of such changes. regards, tom lane