Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFU1A-0000NE-5W for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Feb 2022 04:46:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFU18-0002sL-Tk for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Feb 2022 04:46:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFU18-0002sC-In for pgsql-hackers@lists.postgresql.org; Thu, 03 Feb 2022 04:46:46 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nFU10-00066q-03 for pgsql-hackers@lists.postgresql.org; Thu, 03 Feb 2022 04:46:46 +0000 Received: by mail-pf1-x430.google.com with SMTP id 192so1221592pfz.3 for ; Wed, 02 Feb 2022 20:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=Mm87Yy9iTh8KuPHFSY+lDQ6bMVLg0nvSTCHsav0Wd/I=; b=HuYGiqOBF7qob8j8tpFhvMdxnHU5Y/GLaO/7zAATLSsJGzcYPF8D9MLYeagrCS0UsK ImpdwhpULqIrb6BH5F3msethAU9Z+JV7qOkSBQxZzHI9L8hJllNEGcHhWxqNiaAxHl30 VOd447snae0d9fCaSLcResVFRSZL5+yGbqRWd/AVJ3hTJXufgQgJPzYKoEhw3HvADoa8 LR4VtBB+OtqeQyQmUHbSxHIDTJo/qo0rbmNilNkihRxix3GnKVj7sjvIvsSi6utbNgV4 MgsZxehVm3vx8hiN94FeUkatDMH2HGHPiOfJXuwFf5haIPNgTw0zWE6boNpvEWsSphrL 4PRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Mm87Yy9iTh8KuPHFSY+lDQ6bMVLg0nvSTCHsav0Wd/I=; b=v0mPQyWUziEh0ZNu2ievL5u/JOFEW+cloMPWmFXC09Xr0NHUUsxqrxoCp36q4L+0MN 1Jd1L+myyr4DpJDiaJ+DwQ3A+uGYyYSaGbioe9M8zkBN7xOzVNhyN6JdyyRQLt/Hqz2d 4UXx66ZWh0LE3rWrfU+e+mABcaRM+O7l8HjZ+zZOMdvwf+3HZbG7uYGDqCtsNQ3Q+xFz J0zJlP6dBGI3J2rBos9Dh+TKixITg525aywrlAcPlvAc/7VNvT/j+dcQbn2ECDSW3CET ZCeQTewV8K1Wz9q8m/gEOciZuCIqvkWD1rPKHIsCAV15oJ1EQ4enZAxpAC1oI+XCs6LS T/JQ== X-Gm-Message-State: AOAM5312MKh+Z9zIQUU8IPXSyH8q0cebRufEyGb67ZkwpswZPfW4s7s5 yQaKzL2aok3IYtXYNJjLGSk= X-Google-Smtp-Source: ABdhPJz7DwT3o55O7GFqMWBgUoYD8RQXZoY5iO1gPTHVDUWf/eFv9vJypVe58b84rwrp4pqMIB7ErQ== X-Received: by 2002:a05:6a00:238b:: with SMTP id f11mr4474356pfc.73.1643863595845; Wed, 02 Feb 2022 20:46:35 -0800 (PST) Received: from jrouhaud (2001-b011-1005-388e-e408-374d-0329-2d35.dynamic-ip6.hinet.net. [2001:b011:1005:388e:e408:374d:329:2d35]) by smtp.gmail.com with ESMTPSA id q1sm8004288pjd.48.2022.02.02.20.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 20:46:35 -0800 (PST) Date: Thu, 3 Feb 2022 12:46:26 +0800 From: Julien Rouhaud To: Pavel Stehule Cc: Swaha Miller , PostgreSQL Hackers Subject: Re: support for CREATE MODULE Message-ID: <20220203044626.e25flq74pswafejp@jrouhaud> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Thu, Feb 03, 2022 at 05:25:27AM +0100, Pavel Stehule wrote: > > čt 3. 2. 2022 v 3:28 odesílatel Swaha Miller > napsal: > > > Hi, > > > > I'm following up from Jim's POC for adding MODULE to PostgreSQL. [1] > > > > My proposal implements modules as schema objects to be stored in a new > > system catalog pg_module with new syntax for CREATE [OR REPLACE] MODULE, > > ALTER MODULE, DROP MODULE and for GRANT and REVOKE for privileges on > > modules and module routines. I am attempting to follow the SQL spec. > > However, for right now, I'm proposing to support only routines as module > > contents, with local temporary tables and path specifications as defined > > in the SQL spec, to be supported in a future submission. We could also > > include support for variables depending on its status. [2] > > I dislike this feature. The modules are partially redundant to schemas and > to extensions in Postgres, and I am sure, so there is no reason to > introduce this. > > What is the benefit against schemas and extensions? I agree with Pavel. It seems that it's mainly adding another namespacing layer between schemas and objects, and it's likely going to create a mess. That's also going to be problematic if you want to add support for module variables, as you won't be able to use e.g. dbname.schemaname.modulename.variablename.fieldname. Also, my understanding was that the major interest of modules (at least for the routines part) was the ability to make some of them private to the module, but it doesn't look like it's doing that, so I also don't see any real benefit compared to schemas and extensions.