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 1oEaSs-0002Vb-B2 for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Jul 2022 17:59:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEaSo-0007zS-Az for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Jul 2022 17:59:54 +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 1oEaRp-0006CR-Gc for pgsql-bugs@lists.postgresql.org; Thu, 21 Jul 2022 17:58:53 +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 1oEaRk-0005pP-JP for pgsql-bugs@lists.postgresql.org; Thu, 21 Jul 2022 17:58:53 +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 26LHwi9M130690; Thu, 21 Jul 2022 13:58:44 -0400 From: Tom Lane To: Dean Rasheed cc: Timo Stolz , PostgreSQL mailing lists , Jonas Reinsch , Laura Schlimmer Subject: Re: If a row-level security policy contains a set returning function, pg_dump returns an incorrect serialization of that policy if the return type of the function was altered In-reply-to: References: <5c91267e-3b6d-5795-189c-d15a55d61dbb@nullachtvierzehn.de> <1983818.1658350464@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Thu, 21 Jul 2022 08:19:04 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <130688.1658426324.1@sss.pgh.pa.us> Date: Thu, 21 Jul 2022 13:58:44 -0400 Message-ID: <130689.1658426324@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dean Rasheed writes: > On Wed, 20 Jul 2022 at 21:54, Tom Lane wrote: >> The larger issue that this touches on is that we don't prevent you from >> dropping the composite type's column even when the query using the >> dependent function has hard references to that column (e.g, it's actually >> output by the view). Maybe sometime somebody ought to work on tightening >> that up. In the meantime though, it's bad for EXPLAIN or pg_dump to fail >> altogether on such cases, so I propose the behavior shown in the attached >> patch. > +1. LGTM. Pushed, thanks for reviewing! I think I'll go take a look at the missing-dependency aspect now. I realized from checking the commit log that we've been putting off doing that since 2014, if not before. Really should fix it. regards, tom lane