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 1o1vO7-0007Yg-46 for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jun 2022 19:42:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o1vO4-0008Ft-6K for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jun 2022 19:42:40 +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 1o1vO3-0008Fk-Th for pgsql-hackers@lists.postgresql.org; Thu, 16 Jun 2022 19:42:39 +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 1o1vNy-0000uR-AB for pgsql-hackers@lists.postgresql.org; Thu, 16 Jun 2022 19:42:39 +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 25GJfoMD967229; Thu, 16 Jun 2022 15:41:50 -0400 From: Tom Lane To: Robert Haas cc: Mark Wong , Greg Stark , Chapman Flack , Ashutosh Bapat , PostgreSQL Hackers Subject: Re: real/float example for testlibpq3 In-reply-to: References: <2511609.1646061540@sss.pgh.pa.us> <621D4CF3.6090808@anastigmatix.net> <2746817.1646088530@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Thu, 16 Jun 2022 15:06:01 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <967227.1655408510.1@sss.pgh.pa.us> Date: Thu, 16 Jun 2022 15:41:50 -0400 Message-ID: <967228.1655408510@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Tue, Jun 14, 2022 at 1:40 PM Mark Wong wrote: >> I've created a function for each data type with the idea that an example >> for handling a specific data type can be more easily reviewed by looking >> in a single place. >> I've added examples for REAL, TIMESTAMP WITHOUT TIME ZONE, and BOOLEAN >> to try to illustrate how testlibpq3.sql and testlibpq3.c will grow if >> this is a good way to go. > I'm not sure that we want to let these test programs grow very large. > In particular, I don't think we should let ourselves get sucked into > adding an example for every data type under the sun -- if that's > wanted, the solution is perhaps to add documentation for the binary > formats, not hide impromptu documentation inside a test program. But > doing this much seems OK to me. Yeah, "hiding impromptu documentation inside a test program" is what this looks like, and I'm not sure that's a reasonable way to go. (1) Who's going to think to look in src/test/examples/testlibpq3.c for documentation of binary formats? (2) The useful details are likely to get buried in notational and portability concerns, as I think your build failure illustrates. (3) I bet few if any packagers install these files, so that the new info would be unavailable to many people. I think some new appendix in the main SGML docs would be the appropriate place if we want to provide real documentation. regards, tom lane