Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ai24k-0005Wp-1P for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2016 15:49:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ai24j-0003Bk-H1 for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2016 15:49:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ai23O-0001eI-8g for pgsql-hackers@postgresql.org; Mon, 21 Mar 2016 15:47:38 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ai23I-0004fA-Nw for pgsql-hackers@postgresql.org; Mon, 21 Mar 2016 15:47:37 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.83.202.40]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 8D956400E9A; Mon, 21 Mar 2016 08:47:25 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 48A8E59F; Mon, 21 Mar 2016 12:24:32 -0300 (CLT) Date: Mon, 21 Mar 2016 12:24:32 -0300 From: Alvaro Herrera To: Abhijit Menon-Sen Cc: pgsql-hackers@postgresql.org Subject: Re: dealing with extension dependencies that aren't quite 'e' Message-ID: <20160321152432.GA358168@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160321135331.GA14725@toroid.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Abhijit Menon-Sen wrote: > + else if (strcmp(defel->defname, "extdepend") == 0) > + { > + if (*extdepend_item) > + goto duplicate_error; > + > + *extdepend_item = defel; > + } > else > return false; > I'm not sure I agree with this implementation. I mentioned ALTER .. SET SCHEMA and ALTER .. OWNER TO as examples because, since other object types were mentioned as possible targets for this command, then this should presumably object-type-agnostic, like those ALTER forms are. So IMO we shouldn't shoehorn this into AlterFunctionStmt but rather have its own node AlterObjectDepends or similar. The other point is that if we're doing it in ALTER FUNCTION which allows multiple subcommands in one go, why do we not allow to run this command for multiple extensions? After all, it's not completely stupid to think that one function could depend on multiple extensions, and so if you agree with that then it's not completely stupid that it should be possible to declare such in one command, i.e. ALTER FUNCTION .. DEPENDS ON EXTENSION one, two; or perhaps ALTER FUNCTION .. DEPENDS ON EXTENSION one, DEPENDS ON EXTENSION two; -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers