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 1nOhnr-00074H-93 for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Feb 2022 15:19:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nOhnp-0006ZQ-QH for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Feb 2022 15:19:09 +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 1nOhnp-0006Yw-HU for pgsql-hackers@lists.postgresql.org; Mon, 28 Feb 2022 15:19:09 +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 1nOhnj-0005G3-D9 for pgsql-hackers@lists.postgresql.org; Mon, 28 Feb 2022 15:19:09 +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 21SFJ0l02511610; Mon, 28 Feb 2022 10:19:01 -0500 From: Tom Lane To: Ashutosh Bapat cc: Mark Wong , PostgreSQL Hackers Subject: Re: real/float example for testlibpq3 In-reply-to: References: Comments: In-reply-to Ashutosh Bapat message dated "Mon, 28 Feb 2022 18:33:30 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2511608.1646061540.1@sss.pgh.pa.us> Date: Mon, 28 Feb 2022 10:19:00 -0500 Message-ID: <2511609.1646061540@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ashutosh Bapat writes: > I am wondering whether we should provide PQgetfloatvalue() which does > what that example shows but transparently. It will return a float > value of the given field instead of char *. I'm against that, precisely because ... > That will standardize the > way to fetch real typed values in libpq. That leads to the next > question. Do we need to introduce different PQget*value() for standard > C/SQL data types. ... I do not want to go here. Where would you stop? How would you deal with cross-machine inconsistencies in integer widths? regards, tom lane