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 1oa8RN-0005br-IY for pgsql-general@arkaria.postgresql.org; Mon, 19 Sep 2022 04:31:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oa8RM-0008Gz-1a for pgsql-general@arkaria.postgresql.org; Mon, 19 Sep 2022 04:31:28 +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 1oa8RL-0008Fs-Na for pgsql-general@lists.postgresql.org; Mon, 19 Sep 2022 04:31: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 1oa8RJ-00014Z-Hq for pgsql-general@lists.postgresql.org; Mon, 19 Sep 2022 04:31:27 +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 28J4VL1s257593; Mon, 19 Sep 2022 00:31:21 -0400 From: Tom Lane To: Bryn Llewellyn cc: Adrian Klaver , pgsql-general list Subject: Re: =?utf-8?B?UmU6IFdoZXJlJ3MgdGhlIGRvYyBmb3IgImFycmF5KCkiIOKAlCBh?= =?utf-8?B?cyBpbiAic2VsZWN0IGFycmF5KHZhbHVlcyAoMTcpLCAoNDIpKSI=?= In-reply-to: References: Comments: In-reply-to Bryn Llewellyn message dated "Sun, 18 Sep 2022 21:20:01 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <257591.1663561881.1@sss.pgh.pa.us> Date: Mon, 19 Sep 2022 00:31:21 -0400 Message-ID: <257592.1663561881@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bryn Llewellyn writes: > Why is the "array()" constructor not found in "pg_proc"? Because it isn't a function. Yeah, it kind of looks like one, but its argument is a subquery. If SQL had first-class functions and closures, maybe ARRAY() could be implemented as an ordinary function. But I don't see any plausible way to do that as things stand. There are a bunch of other things that look like functions but aren't in pg_proc, too :-(. Most of them are just catering to the SQL committee's weird allergy to writing functions with plain function syntax. But ARRAY()'s problem is semantic not syntactic. regards, tom lane