Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahxts-0001Ms-EA for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2016 11:21:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ahxtr-0002UQ-Gb for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2016 11:21:31 +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 1ahxsU-0000qv-Lb for pgsql-hackers@postgresql.org; Mon, 21 Mar 2016 11:20:06 +0000 Received: from raven.toroid.org ([178.63.84.200]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahxsP-0006tz-DC for pgsql-hackers@postgresql.org; Mon, 21 Mar 2016 11:20:05 +0000 Received: from kea.toroid.org (unknown [10.9.8.10]) by raven.toroid.org (Postfix) with ESMTP id 3CDCEE5000D; Mon, 21 Mar 2016 12:20:00 +0100 (CET) Received: by kea.toroid.org (Postfix, from userid 1000) id 6FD124E140B; Mon, 21 Mar 2016 16:49:59 +0530 (IST) Date: Mon, 21 Mar 2016 16:49:59 +0530 From: Abhijit Menon-Sen To: Alexander Korotkov Cc: Alvaro Herrera , pgsql-hackers@postgresql.org Subject: Re: dealing with extension dependencies that aren't quite 'e' Message-ID: <20160321111959.GA12784@toroid.org> References: <20160301012745.GA11489@toroid.org> <20160319204625.GA318727@alvherre.pgsql> <20160321063440.GA20891@toroid.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -1.9 (-) 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 At 2016-03-21 13:04:33 +0300, a.korotkov@postgrespro.ru wrote: > > I'm not sure why we want to make new dependency type by ALTER FUNCTION > command, not ALTER EXTENSION? It's a matter of semantics. It means something very different than what an 'e' dependency means. The extension doesn't own the function (and so pg_dump shouldn't ignore it), but the function depends on the extension (and so dropping the extension should drop it). > The argument could be that 'x' dependency type would be used for other > objects not extensions. I suppose this is possible, but yes, I agree with you that it's not clear how or why this would be useful. > So, I would prefer this patch to extend ALTER EXTENSION command while > it's aimed to this particular problem. OK, so that's what the patch does, and it's certainly the simplest approach for reasons discussed earlier (though perhaps not as clear semantically as the ALTER FUNCTION approach). But: > I even think we could extend existent grammar rule > > | ALTER EXTENSION name add_drop FUNCTION function_with_argtypes > > *************** AlterExtensionContentsStmt: > > *** 3982,3987 **** > > --- 3987,3993 ---- > > n->objtype = OBJECT_FUNCTION; > > n->objname = $6->funcname; > > n->objargs = $6->funcargs; > > + n->deptype = 'e'; > > $$ = (Node *)n; > > } How exactly do you propose to do this, i.e., what would the final command to declare an 'x' dependency look like? -- Abhijit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers