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 1nFncY-0003SY-Sx for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Feb 2022 01:42:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFncX-00023Z-Ha for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Feb 2022 01:42:41 +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 1nFncX-00023Q-7d for pgsql-hackers@lists.postgresql.org; Fri, 04 Feb 2022 01:42:41 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFncT-0007x2-7H for pgsql-hackers@lists.postgresql.org; Fri, 04 Feb 2022 01:42:40 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0AB875C00FD; Thu, 3 Feb 2022 20:42:35 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 03 Feb 2022 20:42:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=hLGG9oUTyPO7t1GZWGLSrGfFChzSgnMkH/Dgoq88UMw=; b=hfXZoh5r 8D9rVQRYTBIfhXPGgWBsEssiYtMjuvv9MkUnkPnMHk/D+izLS6MtOm4BxZ+0kWhZ pvQoFmTlEyMmo52fmjYp5OZPMoGuPFiT+6likg/K4LJeipSeZGVWIA6gQzJeYShE oBKitaD/ZSvIWunj2bxV0drtr8Qm5ASqr7P7mg3u7BETY2HLl2tBDovgGEc10Pf1 q+zg13XArzqKjDxjSjKORc8zbdxeA9Jwd+HJXkQYocKW7xlrF7mX7kh7eAccRstI 6B5L5v7pe2X9FoIoKYC3tAMmLaMbWmdAnqDtIH5D9XFAvkatYbifKn1FFrnmoIJT Yjv1SbfjirPSqw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrgeekgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepjeejveffueekjeeikeehheeludduheetiedugeetteekhfev lefhfedvuddvgfefnecuffhomhgrihhnpehpohhsthhgrhdrvghspdgvnhhtvghrphhrih hsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Feb 2022 20:42:34 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 288982A0803; Thu, 3 Feb 2022 22:42:32 -0300 (-03) Date: Thu, 3 Feb 2022 22:42:32 -0300 From: Alvaro Herrera To: Pavel Stehule Cc: Julien Rouhaud , Swaha Miller , PostgreSQL Hackers Subject: Re: support for CREATE MODULE Message-ID: <202202040142.luk526wfnjjl@alvherre.pgsql> 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 On 2022-Feb-03, Pavel Stehule wrote: > The biggest problem is coexistence of Postgres's SEARCH_PATH object > identification, and local and public scopes used in MODULEs or in Oracle's > packages. > > I can imagine MODULES as third level of database unit object grouping with > following functionality > > 1. It should support all database objects like schemas I proposed a way for modules to coexist with schemas that got no reply, https://postgr.es/m/202106021908.ddmebx7qfdld@alvherre.pgsql I still think that that idea is valuable; it would let us create "private" routines, for example, which are good for encapsulation. But the way it interacts with schemas means we don't end up with a total mess in the namespace resolution rules. I argued that modules would only have functions, and maybe a few other useful object types, but not *all* object types, because we don't need all object types to become private. For example, I don't think I would like to have data types or casts to be private, so they can only be in a schema and they cannot be in a module. Of course, that idea of modules would also ease porting large DB-based applications from other database systems. What do others think? -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/