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 1r2CmZ-00FTpu-AF for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Nov 2023 15:53:55 +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 1r2CmW-00AvbQ-O5 for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Nov 2023 15:53:52 +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 1r2CmW-00AvbH-Ek for pgsql-bugs@lists.postgresql.org; Sun, 12 Nov 2023 15:53:52 +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 1r2CmP-0064kA-Jd for pgsql-bugs@lists.postgresql.org; Sun, 12 Nov 2023 15:53:51 +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 3ACFrYnZ1740511; Sun, 12 Nov 2023 10:53:35 -0500 From: Tom Lane To: "Karl O. Pinc" cc: "David G. Johnston" , "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #18190: PL/pgSQL does not document comparison operations on RECORD (or ROW) types In-reply-to: <20231112092244.5cad27f8@slate.karlpinc.com> References: <18190-ba5eff0af347078d@postgresql.org> <20231112092244.5cad27f8@slate.karlpinc.com> Comments: In-reply-to "Karl O. Pinc" message dated "Sun, 12 Nov 2023 09:22:44 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1740509.1699804414.1@sss.pgh.pa.us> Date: Sun, 12 Nov 2023 10:53:34 -0500 Message-ID: <1740510.1699804414@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Karl O. Pinc" writes: > Perhaps I'm too used to reading the PL/pgSQL chapter, which > makes it sound like RECORD variables are strictly a PL/pgSQL > construct. (And maybe they are.) It's unclear why this would matter, > and how such a thought would throw off my searching. But something > did. Variables in general are a PL/pgSQL construct, but RECORD can be used in other contexts; for example as the argument or return type of a function, whether it's in PL/pgSQL or not. (Some PLs may reject that, but that's an implementation shortcoming of the PL.) Also, the result of any ROW() constructor is of type RECORD unless it's cast to some named composite type. > (FWIW, The sentence "Note that RECORD is not a true data type, > only a placeholder." is pretty mysterious. I don't see anything > that informs me about what a RECORD variable is, composite, > ROW type, or whatever.) I think you are on to something here. I'm not very sure what we should write instead of what's there, but I think that that sentence predates our invention of polymorphic types. It would likely be better to frame RECORD as a polymorphic type that can range over (only) composite types, and to provide cross-references to the main docs' sections about composites (and maybe polymorphics). Too caffeine-deprived to propose any specific wording, but I think this area could use some work. regards, tom lane