Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chigc-0007Ab-6q for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Feb 2017 20:11:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1chigb-0007Me-Oi for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Feb 2017 20:11:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1chigZ-0007MU-Qe for pgsql-hackers@postgresql.org; Sat, 25 Feb 2017 20:11:19 +0000 Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1chigW-0000nP-6d for pgsql-hackers@postgresql.org; Sat, 25 Feb 2017 20:11:18 +0000 Received: by mail-qk0-x22a.google.com with SMTP id n127so49989207qkf.0 for ; Sat, 25 Feb 2017 12:11:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=H/uXuiCzNaHr1TMEwI/CleNz2rHHq8p257sLk+hYBfo=; b=hhgxoVqw4YNpU0jLfIF12wTsUXmOMkUR1cf/Z+idBjzVHDh4FA4D6f29Ej0PZ0lELt boKIuG4RZ/MuqxBvi5wmmEUhJiKlF4OVVfiRu4ypj7mp6apSp7904rFnCR12fAqeVYgK ExIECdaYREN/avD8oQ6zKlgks9CTKMvXFlLckFo1VLfoyxF1w3naD8or4oTNSFNKIkBj 4XHh3ze+NK4djsAty4boueDk9WmVbt7tv/cq/0LtFNUecjjFq0U1Ps81609SY141Pd0H hTuGp5BHj0DR3mMmNtVGG/alIJCPy0VC4lD8eON5lYbfZicTOx0PpGzjJHoo6aqt4VKZ bGaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=H/uXuiCzNaHr1TMEwI/CleNz2rHHq8p257sLk+hYBfo=; b=SQ/IzwR8/LhNmxxe0PSL3YGZiFHLwYxxnUgxHe5rjiasX0UyM3S4JWhkt3EC24diLa 94P8Je5E8s+aG+PXo8OOk1Nkc6t0KdbmQ806xaXWzv5yDuVoZthxhjzDn17ktfs3T7Cc QRoYnwyv8Z1MD+olPs9SQLQ4BI3t6ZwlEInt6WYUnSp8v5G1eb+k0EnazKpQyTQxauak oq4DGs7SXFrTyUmHkF5D/qmVZwhHT+JrOPNJ6BVcPD7SIBV28+acMUYDcubxHL0rkG6v mXYaQYMh1+xLB1DH1PtKwXI3INzMOvbQ5rAzfgVd9Szo1SqmzO1KLwH+fVHeatQAqX/w loYQ== X-Gm-Message-State: AMke39laf6SHqN0l7kpE811XR3Ns7vpKgZXWO86Zyq33UTd7pTEfsvEpED5GPOMzVQlA9xeD X-Received: by 10.200.4.30 with SMTP id v30mr8717692qtg.171.1488053474266; Sat, 25 Feb 2017 12:11:14 -0800 (PST) Received: from [192.168.10.146] ([98.122.164.227]) by smtp.gmail.com with ESMTPSA id o9sm7393324qtg.7.2017.02.25.12.11.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Feb 2017 12:11:13 -0800 (PST) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: I propose killing PL/Tcl's "modules" infrastructure To: Tom Lane References: <22067.1488046447@sss.pgh.pa.us> <234c68e3-47ee-4db1-fe6d-6a5de56575b6@2ndQuadrant.com> <23184.1488048288@sss.pgh.pa.us> <33fe0208-74df-1a03-08af-9a4f0d1ed14d@2ndQuadrant.com> <24478.1488050485@sss.pgh.pa.us> Cc: pgsql-hackers@postgresql.org, Jan Wieck Message-ID: <45faa542-212a-5225-2b62-c80a8df2d0fd@2ndQuadrant.com> Date: Sat, 25 Feb 2017 15:11:12 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <24478.1488050485@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 On 02/25/2017 02:21 PM, Tom Lane wrote: > Andrew Dunstan writes: >> On 02/25/2017 01:44 PM, Tom Lane wrote: >>> 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? >> Yes, it's a regular PLv8 function. > OK ... how do you handle security considerations? Can the GUC be set > at any time/by anybody? What determines whether you have permissions > to call the particular function? > > It can be set by anyone, IIRC. Maybe it should be SUSET only, I don't know. It's executed as the session owner. Execute permission on the function are determined the same way as for any function. It's an ordinary function call. The only difference is in how the call gets triggered. cheers andrew -- Andrew Dunstan https://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