Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVYHe-000XJK-6a for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Aug 2023 14:11:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qVYHc-004t9V-Ux for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Aug 2023 14:11:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVYHc-004t9N-L0 for pgsql-hackers@lists.postgresql.org; Mon, 14 Aug 2023 14:11:00 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVYHa-0005j2-AY for pgsql-hackers@postgresql.org; Mon, 14 Aug 2023 14:10:59 +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 37EEAEnH903342; Mon, 14 Aug 2023 10:10:14 -0400 From: Tom Lane To: Chapman Flack cc: Andy Fan , Pavel Stehule , jian he , pgsql-hackers Subject: Re: Extract numeric filed in JSONB more effectively In-reply-to: <900892914fdc3f477b101d699efb40e0@anastigmatix.net> References: <3507485.1691090027@sss.pgh.pa.us> <900892914fdc3f477b101d699efb40e0@anastigmatix.net> Comments: In-reply-to Chapman Flack message dated "Mon, 14 Aug 2023 10:04:03 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <903340.1692022214.1@sss.pgh.pa.us> Date: Mon, 14 Aug 2023 10:10:14 -0400 Message-ID: <903341.1692022214@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Chapman Flack writes: > Providing a function with return type declared internal but > with no parameter of that type is not good, Not so much "not good" as "absolutely, positively WILL NOT HAPPEN". > because then a > user could, in principle, call it and obtain a value of > 'internal' type, and so get around the typing rules that > prevent calling other internal functions. Right --- it'd completely break the system's type-safety for other internal-using functions. You could argue that we should never have abused "internal" to this extent in the first place, compared to inventing a plethora of internal-ish types to correspond to each of the things "internal" is used for. But here we are so we'd better be darn careful with it. regards, tom lane