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 1sqgEe-00Bo0v-4F for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Sep 2024 21:59:49 +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 1sqgEb-00GiOd-18 for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Sep 2024 21:59:45 +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 1sqgEa-00GiOV-Ml for pgsql-hackers@lists.postgresql.org; Tue, 17 Sep 2024 21:59:44 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sqgEX-001iC0-05 for pgsql-hackers@lists.postgresql.org; Tue, 17 Sep 2024 21:59:44 +0000 Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-82ce1cd2026so218301339f.3 for ; Tue, 17 Sep 2024 14:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726610380; x=1727215180; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=zmbJZutn/fDO1NAUKIiNpnrpK5JQn+kkE6PjtDitEHk=; b=I4sLyuXMaOhrl3h5Hzv5arffErlARX7/P2ejKtjAfiZC0My+i/JUiXcdLSDt2L8VyQ 3J6nbffaYH/8uy52uQaOOhg/I4oZ8PqA3CGzoys+4VZEgCVhzMrbCPPWPzFuKFRctTzR L05ruiFrNy671mjiyccc+0x/wri8Xx/++JK+UHGJpS32NBSAuy0CIGU8VQZVJIMd5Y9Y +3FJ7BrKjr4qTWikEOtKkd7m2KXDChALBp0Pq/Sa5UxyD3pRYUpj1dKAl4VV+3uXqGJ8 61iQaVb4mAIDqoiPTtyaoWhtDWl0a8RwFZJxHmd7ddd4ebSQXwHvCHIg49fLpyUpaX8b 5lCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726610380; x=1727215180; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zmbJZutn/fDO1NAUKIiNpnrpK5JQn+kkE6PjtDitEHk=; b=KiPFEfpaJBq3/SiU1VPFuiWhuA9ajxW7J5XS47rgiw+zYpG+dnQL0CUtapnqboX+kX U0s3lFA8/Yn5hFDv8NQf00Ywr+51xdf00PMF/cMH1460W08lrC1XHrh4MZE7yL19EVxN H4t0OqcxtwmsAH4IrlyV+8wueq37rEEaKkjEoKlq/sZD8UNbaJ0WWH+90IpvMEcf+VjI lJ7s5RjI1vTxtYMOdYF2QTSnSbO8N6ZYTliKFTe279+qHRdbFJy7GKwrvhMXNcMcPDxy oTJ/nhg37VDAGqc0bfjtQe2L6lbbnrDpGep3mUJW+kHk5xsEUKRL8AhK7jSdaqHzkCQU g+4w== X-Gm-Message-State: AOJu0Yz3Pgkuon7lG65cOr1z3z6Uzj21GjKhg2PYcD+58Om4OjaAKA5r +jNeAhDrkTI8StBOOalsAEMSnpitran8+qA4iOPEFLNywnGTw1nf X-Google-Smtp-Source: AGHT+IGS5rDwNTMUpBZV1T0wcJzAOr8+WnH/SyxMiiDOg8iy+KWf8nFKpdxweRLhDvr3OJjR5I6giQ== X-Received: by 2002:a92:874e:0:b0:3a0:8c83:91fb with SMTP id e9e14a558f8ab-3a08c83928emr111977495ab.20.1726610379927; Tue, 17 Sep 2024 14:59:39 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a092e10445sm24342445ab.21.2024.09.17.14.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 14:59:39 -0700 (PDT) Date: Tue, 17 Sep 2024 16:59:37 -0500 From: Nathan Bossart To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org, Maciek Sakrejda , Hunaid Sohail Subject: Re: Test improvements and minor code fixes for formatting.c. Message-ID: References: <2956175.1725831136@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2956175.1725831136@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Sep 08, 2024 at 05:32:16PM -0400, Tom Lane wrote: > In looking at this, I found that there's also no test coverage > for the EEEE, V, or PL format codes. Also, the possibility of > overflow while converting an input value to int in order to > pass it to int_to_roman was ignored. Attached is a patch that > adds more test coverage and cleans up the Roman-numeral code > a little bit. I stared at the patch for a while, and it looks good to me. > BTW, I also discovered that there is a little bit of support > for a "B" format code: we can parse it, but then we ignore it. > And it's not documented. Oracle defines this code as a flag > that: > > Returns blanks for the integer part of a fixed-point number > when the integer part is zero (regardless of zeros in the > format model). > > It doesn't seem super hard to implement that, but given the > complete lack of complaints about it being missing, maybe we > should just rip out the incomplete support instead? AFAICT it's been like that since it was introduced [0]. I searched the archives and couldn't find any discussion about this format code. Given that, I don't have any concerns about removing it unless it causes ERRORs for calls that currently succeed, but even then, it's probably fine. This strikes me as something that might be fun for an aspiring hacker, though. [0] https://postgr.es/c/b866d2e -- nathan