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 1lWjRE-0004Dj-Sh for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Apr 2021 17:36:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lWjRD-0008Jm-7K for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Apr 2021 17:36:27 +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 1lWjRD-0008Je-0f for pgsql-hackers@lists.postgresql.org; Wed, 14 Apr 2021 17:36:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWjRB-0000QN-0S for pgsql-hackers@lists.postgresql.org; Wed, 14 Apr 2021 17:36:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13EHaMpM3565759; Wed, 14 Apr 2021 13:36:22 -0400 From: Tom Lane To: Mark Dilger cc: PostgreSQL Hackers , Peter Eisentraut Subject: Re: Converting contrib SQL functions to new style In-reply-to: References: <3395418.1618352794@sss.pgh.pa.us> Comments: In-reply-to Mark Dilger message dated "Wed, 14 Apr 2021 10:18:30 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3565757.1618421782.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 14 Apr 2021 13:36:22 -0400 Message-ID: <3565758.1618421782@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mark Dilger writes: >> On Apr 13, 2021, at 3:26 PM, Tom Lane wrote: >> However I think we may still need an assumption that earthdistance >> and cube are in the same schema --- any comments on that? > This is probably not worth doing, and we are already past feature > freeze, but adding syntax to look up the namespace of an extension might > help. Yeah, that idea was discussed before (perhaps only in private security-team threads, though). We didn't do anything about it because at the time there didn't seem to be pressing need, but in the context of SQL function bodies there's an obvious use-case. > We could get something like this working just inside the CREATE EXTENSIO= N command if we expanded on the @extschema@ idea a bit. At first I though= t this idea would suffer race conditions with concurrent modifications of = pg_extension or pg_namespace, but it looks like we already have a snapshot= when processing the script file, so: > -CREATE DOMAIN earth AS cube > +CREATE DOMAIN @@earthdistance@@::earth AS @@cube@@::cube Right, extending the @extschema@ mechanism is what was discussed, though I think I'd lean towards something like @extschema:cube@ to denote the schema of a referenced extension "cube". I'm not sure this is useful enough to break feature freeze for, but I'm +1 for investigating it for v15. regards, tom lane