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 1lX5i7-0005P2-Ll for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Apr 2021 17:23:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lX5i6-0002ak-Ap for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Apr 2021 17:23:22 +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 1lX5i6-0002ad-3q for pgsql-hackers@lists.postgresql.org; Thu, 15 Apr 2021 17:23:22 +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 1lX5i3-0005aZ-7q for pgsql-hackers@lists.postgresql.org; Thu, 15 Apr 2021 17:23:21 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7D8AE5C0107; Thu, 15 Apr 2021 13:23:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 15 Apr 2021 13:23:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=ue7lBW9xOJOgwB/iimz4CM65+75Z5K2RQKX48ahzxhE=; b=Oh5uXYES 8tV6/J75XnrJaSc1gz6WdbhGrteN0d24sn9m5oJhBBEOJmbDGTxmDi0wuzmoOM5p JVFemfhwAweIwOsNv1wDIvVI//351wEKZ0250Ql1tibZikUdSqU3lQPVpmYeI0vO MuvSsFAjrjAQBUvIs7+ToUM/WgPFpoZma06MkE1SoPDyYU92XfHQLxQKmt87ombE WfaFkxV7CfsUsEcEKzLYDda+ztjCrnC5puZBNTUuS/wTaar06D0ilqiKvCId0Ypa ezgdNyRlEbN2+DIZaUHQEd++kPhtqdckD7OWXXczzSOtESUN64iVrqhRe8GURvey lbqB4txBZISfzw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudelfedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpeeufffhjeeiueeuffegvddukeegledtveeivdeiueef ieeivefgteehueefteehvdenucfkphepudeltddrleehrdduledrleehnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegr lhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id BBE12240069; Thu, 15 Apr 2021 13:23:16 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id DB72B2A41A2; Thu, 15 Apr 2021 13:23:13 -0400 (-04) Date: Thu, 15 Apr 2021 13:23:13 -0400 From: Alvaro Herrera To: Vik Fearing Cc: Mark Dilger , Tom Lane , PostgreSQL Hackers , Peter Eisentraut , Robert Haas Subject: Re: Converting contrib SQL functions to new style Message-ID: <20210415172313.GA9186@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5c2edf80-d1e3-cb9a-e5a8-41f3ad59515a@postgresfriends.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Apr-15, Vik Fearing wrote: > CREATE DOMAIN earth AS "$extension".cube.cube > CONSTRAINT not_point check("$extension".cube.cube_is_point(value)) > CONSTRAINT not_3d check("$extension".cube.cube_dim(value <= 3) > ...; I find this syntax pretty weird -- here, the ".cube." part of the identifier is acting as an argument of sorts for the preceding $extension thingy. This looks very surprising. Something similar to OPERATOR() syntax may be more palatable: CREATE DOMAIN earth AS PG_EXTENSION_SCHEMA(cube).cube CONSTRAINT not_point check(PG_EXTENSION_SCHEMA(cube).cube_is_point(value)) CONSTRAINT not_3d check(PG_EXTENSION_SCHEMA(cube).cube_dim(value <= 3) ...; Here, the PG_EXTENSION_SCHEMA() construct expands into the schema of the given extension. This looks more natural to me, since the extension that acts as argument to PG_EXTENSION_SCHEMA() does look like an argument. I don't know if the parser would like this, though. -- Álvaro Herrera Valdivia, Chile