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 1nKuLe-00062a-62 for pgsql-general@arkaria.postgresql.org; Fri, 18 Feb 2022 03:54:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKuLc-0007vL-JU for pgsql-general@arkaria.postgresql.org; Fri, 18 Feb 2022 03:54:20 +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 1nKuLc-0007vC-8q for pgsql-general@lists.postgresql.org; Fri, 18 Feb 2022 03:54:20 +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 1nKuLW-0001rL-0b for pgsql-general@lists.postgresql.org; Fri, 18 Feb 2022 03:54:19 +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 21I3s7Ux3889547; Thu, 17 Feb 2022 22:54:07 -0500 From: Tom Lane To: "David G. Johnston" cc: Bryn Llewellyn , Adrian Klaver , Alvaro Herrera , pgsql-general list Subject: Re: alter function/procedure depends on extension In-reply-to: References: <7C2D01B4-AD32-48DB-B5FA-6FFBC312ECB2@yugabyte.com> <4c6b69e2-52c6-359d-3ed9-04842f631ffe@aklaver.com> <3781667.1645147045@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Thu, 17 Feb 2022 19:30:57 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3889545.1645156447.1@sss.pgh.pa.us> Date: Thu, 17 Feb 2022 22:54:07 -0500 Message-ID: <3889546.1645156447@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Thu, Feb 17, 2022 at 6:17 PM Tom Lane wrote: >> There is no bug here; it's operating as designed and documented. >> Maybe the docs need some refinement. > We should just say that ALTER FUNCTION ALTER DEPENDS ON makes the target > function/procedure a (transient?) member of the extension and it will be > dropped when the extension be dropped. It's not a member though; there's a different syntax for that (ALTER EXTENSION name ADD member_object). The differences are a bit subtle, but for example making the function an extension member would change how pg_dump treats it. I confess not remembering exactly why we thought the auto-drop behavior was important enough to deserve special infrastructure. Still, it's there now, and the question of dependencies that the dependency system can't see is really quite a different thing. regards, tom lane