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 1nje23-0006n4-Ov for pgsql-general@arkaria.postgresql.org; Wed, 27 Apr 2022 09:32:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nje20-0003Jd-Kf for pgsql-general@arkaria.postgresql.org; Wed, 27 Apr 2022 09:32: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 1nje1z-0003JU-In for pgsql-general@lists.postgresql.org; Wed, 27 Apr 2022 09:32:20 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nje1v-0004yz-I1 for pgsql-general@lists.postgresql.org; Wed, 27 Apr 2022 09:32:19 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 402B7320046E; Wed, 27 Apr 2022 05:32:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 27 Apr 2022 05:32:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1651051930; x=1651138330; bh=q2166SZpJP6v3RaWR6gnPpaQufkp 8rdEryQHbjnPXiE=; b=yV7ZVfdgE2xnTiCaZV4AFAJxwYspvNFIlQ4Q/i89V4S7 ZnUPGXt1zMD1dzvyg9v3fL2WEvDD61gJYIUrfLcA5o0a/cdE8ANC4V3+rhtUt4+8 igdFbRD8fRhh9rXVvb5tNzanb4d/4Hdv7QV+1D6qkxJhfkJYw5P8lUxzBh41yXaS r4XzyRhurgACFWW3aP0RSmaWqpFR7T7oZ/5lzJtb3PFVjwsedlORsS4XtjdPKJLP tnnjBOnb4l/7W3k6Z9Tzx9wCbtz2E7wcjiQWqSEpjjCUZVFm0W2f2v19NPCRRspK Lcw2/dgh4wTSZsSERHZaEo1UakNS5Rxe4X3njH8j4g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudehgddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 27 Apr 2022 05:32:09 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 7EE962A0D07; Wed, 27 Apr 2022 11:32:07 +0200 (CEST) Date: Wed, 27 Apr 2022 11:32:07 +0200 From: Alvaro Herrera To: Tom Lane Cc: Bryn Llewellyn , "David G. Johnston" , pgsql-general list Subject: Re: "create function... depends on extension..." not supported. Why? Message-ID: <202204270932.puduanle4khz@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <294570.1651023111@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Apr-26, Tom Lane wrote: > 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. IIRC Abhijit and I discussed this point offline, and our conclusion was that DEPENDS ON EXTENSION was not of general enough usefulness to warrant support for it in CREATE FUNCTION -- keeping in mind that we would need support for it in CREATE INDEX, CREATE TRIGGER, CREATE MATERIALIZED VIEW as well. It's probably not that much code. The effort of writing the code wasn't the barrier we were optimizing for, but rather for getting the whole *idea* accepted. If this feature is suddenly so useful as to *require* support in the various CREATE commands, that is most satisfying to me and I volunteer to reviewing patches that implement it. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/