Re: I propose killing PL/Tcl's "modules" infrastructure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org, Jan Wieck <jan(at)wi3ck(dot)info>
Subject: Re: I propose killing PL/Tcl's "modules" infrastructure
Date: 2017-02-25 18:44:48
Message-ID: 23184.1488048288@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-02-25 18:46:53 Re: I propose killing PL/Tcl's "modules" infrastructure
Previous Message Bruce Momjian 2017-02-25 18:43:52 Re: Should `pg_upgrade --check` check relation filenodes are present?