Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chhL1-0003Hd-Cx for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Feb 2017 18:44:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1chhL0-0001WG-W1 for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Feb 2017 18:44:59 +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 1chhL0-0001Un-1f for pgsql-hackers@postgreSQL.org; Sat, 25 Feb 2017 18:44:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1chhKt-0004vD-Tt for pgsql-hackers@postgreSQL.org; Sat, 25 Feb 2017 18:44:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v1PIimcR023185; Sat, 25 Feb 2017 13:44:48 -0500 From: Tom Lane To: Andrew Dunstan cc: pgsql-hackers@postgreSQL.org, Jan Wieck Subject: Re: I propose killing PL/Tcl's "modules" infrastructure In-reply-to: <234c68e3-47ee-4db1-fe6d-6a5de56575b6@2ndQuadrant.com> References: <22067.1488046447@sss.pgh.pa.us> <234c68e3-47ee-4db1-fe6d-6a5de56575b6@2ndQuadrant.com> Comments: In-reply-to Andrew Dunstan message dated "Sat, 25 Feb 2017 13:37:26 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23183.1488048288.1@sss.pgh.pa.us> Date: Sat, 25 Feb 2017 13:44:48 -0500 Message-ID: <23184.1488048288@sss.pgh.pa.us> 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 Andrew Dunstan writes: > On 02/25/2017 01:14 PM, Tom Lane wrote: >> Now, we could try to fix this bug, and add the regression test coverage >> that the code clearly lacks, and upgrade the documentation about it from >> its currently very sad state. But I think the right answer is just to >> remove the feature altogether. It's evidently not being used, and it's >> kind of insecure by design, and it would not be that hard for someone >> to provide equivalent functionality entirely in userland if they really >> wanted it. > In PLv8 we added a parameter plv8.start_proc that names a parameterless > function that's executed when plv8 is first called in each session. It > can be used quite easily to implement something like a modules > infrastructure - in fact I have used it to good effect for exactly that. > Maybe something similar for pltcl would be a good thing. Yeah, the only part that's even a bit hard to replicate in userland is initializing the autoloading mechanism in each session. It would be cleaner to provide a feature similar to what you describe that could be used for that purpose as well as others. However, where does the "parameterless function" come from? Is it a regular PLv8 (or for this purpose PL/Tcl) function expected to be present in pg_proc? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers