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.98.2) (envelope-from ) id 1xJDEy-0000000035O-0QvT for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Oct 2026 17:03:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xJDEx-000000012Sr-1LzH for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Oct 2026 17:03:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xJDEx-000000012Si-0MGs for pgsql-bugs@lists.postgresql.org; Tue, 20 Oct 2026 17:03:07 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xJDEv-000000002dL-0Hro for pgsql-bugs@lists.postgresql.org; Tue, 20 Oct 2026 17:03:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 69KH34Rf1052441; Tue, 20 Oct 2026 13:03:04 -0400 From: Tom Lane To: Gowtham Reddy cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19771: to_char(): NUL byte in result for formats with a trailing decimal point (regression from ec352b37d) In-reply-to: <347653.1792370465@sss.pgh.pa.us> References: <19771-4f173b891525020c@postgresql.org> <347653.1792370465@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 18 Oct 2026 20:41:05 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1052439.1792515784.1@sss.pgh.pa.us> Date: Tue, 20 Oct 2026 13:03:04 -0400 Message-ID: <1052440.1792515784@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Normally I'd think we should back-patch, but it's possible that > people didn't realize this behavior was unintended --- else we'd > have heard bug reports sooner. (It's not instantly obvious that > we should drop the decimal point but not the sign, I think.) > So I'm inclined to leave the stable branches alone. Maybe there's > still room to squeeze the fix into v19, though. Hearing no objections, pushed to 19 and master only. A fair question about this is why dropping the decimal point is a good idea at all. Maybe the actual bug is that there's not a decimal point available in the input string. But that would be a bigger behavioral change, and again we've heard no complaints in this area. Even if we did change how the initial conversion works, this patch would remain a good safety feature, so I'm content for now to do this and stop here. regards, tom lane