From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gowtham Reddy <gowthamdoma18@gmail.com>
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)
Date: Tue, 20 Oct 2026 13:03:04 -0400
Message-ID: <1052440.1792515784@sss.pgh.pa.us> (raw)
In-Reply-To: <347653.1792370465@sss.pgh.pa.us>
References: <19771-4f173b891525020c@postgresql.org>
<CAOZ9b+osn=upOQvLYP9uTADw7CqP2nA6Uogsmv9dyQh4EB18ZQ@mail.gmail.com>
<347653.1792370465@sss.pgh.pa.us>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, gowthamdoma18@gmail.com
Subject: Re: BUG #19771: to_char(): NUL byte in result for formats with a trailing decimal point (regression from ec352b37d)
In-Reply-To: <1052440.1792515784@sss.pgh.pa.us>
References: <19771-4f173b891525020c@postgresql.org> <CAOZ9b+osn=upOQvLYP9uTADw7CqP2nA6Uogsmv9dyQh4EB18ZQ@mail.gmail.com> <347653.1792370465@sss.pgh.pa.us> <1052440.1792515784@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox