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 1ri7vW-00FH9t-HI for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2024 07:12:26 +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 1ri7vV-002CTa-2R for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2024 07:12:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ri7vU-002CTS-OS for pgsql-general@lists.postgresql.org; Thu, 07 Mar 2024 07:12:25 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ri7vS-003DnH-EJ for pgsql-general@postgresql.org; Thu, 07 Mar 2024 07:12:24 +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 4277CKKL453186; Thu, 7 Mar 2024 02:12:20 -0500 From: Tom Lane To: Stephen Frost cc: Guyren Howe , PG-General Mailing List Subject: Re: Thoughts on user-defined types for talk at Postgres conference? In-reply-to: References: <506dd5f4-65fe-4d34-8cfe-2ebc08b978e4@Spark> Comments: In-reply-to Stephen Frost message dated "Thu, 07 Mar 2024 01:39:25 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <453184.1709795540.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Mar 2024 02:12:20 -0500 Message-ID: <453185.1709795540@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Stephen Frost writes: > * Guyren Howe (guyren@gmail.com) wrote: >> It seems as though a Composite Type having only fixed-length fields sho= uld be able to be regarded as a fixed-length value. > While I can understand where you're coming from with that, it's > certainly not something the system is built to handle today and, at > least from my recent review of this area, looks like there would be a > fair bit of code involved to get to that point. There are some other fundamental problems here: * To conclude that a tuple of only fixed-length column types is itself fixed-length, you need an additional assumption that all the columns are not-null. This is pretty problematic because we don't even have a way to enforce such a requirement against generic composite types; we really only promise to enforce column constraints against columns of physical tables. * Even if all the semantic enforcement of that were bulletproof, we'd still have a big problem with compatibility of the on-disk representation between current releases and a future release that thought it could elide some part of the tuple header for all-not-null stored composite values. I don't say that these problems are insoluble, but they do look pretty difficult. regards, tom lane