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 1njWX8-0002li-1K for pgsql-general@arkaria.postgresql.org; Wed, 27 Apr 2022 01:31: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 1njWX6-0003DL-Jf for pgsql-general@arkaria.postgresql.org; Wed, 27 Apr 2022 01:31:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1njWX6-0003DC-8r for pgsql-general@lists.postgresql.org; Wed, 27 Apr 2022 01:31:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1njWX3-0004Rk-QR for pgsql-general@lists.postgresql.org; Wed, 27 Apr 2022 01:31:55 +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 23R1VpFs294571; Tue, 26 Apr 2022 21:31:51 -0400 From: Tom Lane To: Bryn Llewellyn cc: "David G. Johnston" , pgsql-general list Subject: Re: "create function... depends on extension..." not supported. Why? In-reply-to: <89961B5A-92D2-4419-BB03-0D07DAD5037E@yugabyte.com> References: <89961B5A-92D2-4419-BB03-0D07DAD5037E@yugabyte.com> Comments: In-reply-to Bryn Llewellyn message dated "Tue, 26 Apr 2022 18:20:46 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <294569.1651023111.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 26 Apr 2022 21:31:51 -0400 Message-ID: <294570.1651023111@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bryn Llewellyn writes: > The discussion has diverging threads and very many turns. I think that I= managed to skim through the entire tree. As I read it, the discussion was= entirely about the semantics of the proposed dependency of a function (or= procedure) upon an extension. The idea to establish such a dependency usi= ng =E2=80=9Calter function=E2=80=9D came up quite early in the discussion.= It seems that establishing it at =E2=80=9Ccreate function=E2=80=9D time w= as never considered. Probably not. Just for the record, it's not true that CREATE and ALTER always have the same set of options. An obvious counterexample is that you can't set the owner to someone different from yourself during CREATE. There may be others. I suppose that "DEPENDS ON EXTENSION" was modeled after the commands to control extension membership, which likewise exist only in ALTER form because CREATE's behavior for that is hard-wired. If you wanted to hand-wave a lot, you could maybe claim that ownership and extension membership/dependency are similar kinds of relationships and so it makes sense that the command structures for manipulating them are similar. But TBH that would probably be reverse-engineering an explanation. I think that "we didn't bother" is more nearly the situation. regards, tom lane