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 1toRCR-00AkIz-8p for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Mar 2025 18:04:32 +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 1toRCR-0012qx-8e for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Mar 2025 18:04:29 +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.94.2) (envelope-from ) id 1toRCQ-0012qp-Ue for pgsql-hackers@lists.postgresql.org; Sat, 01 Mar 2025 18:04:29 +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.96) (envelope-from ) id 1toRCN-000Ny6-2H for pgsql-hackers@lists.postgresql.org; Sat, 01 Mar 2025 18:04:28 +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 521I4LNA3043077; Sat, 1 Mar 2025 13:04:21 -0500 From: Tom Lane To: Alexander Lakhin cc: Jeff Davis , Andres Freund , Corey Huinker , Michael Paquier , jian he , Nathan Bossart , Bruce Momjian , Matthias van de Meent , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org Subject: Re: Statistics Import and Export In-reply-to: <57988cee-5cc8-44f9-981e-8d62e556f5c8@gmail.com> References: <3670503.1740173078@sss.pgh.pa.us> <3728741.1740178078@sss.pgh.pa.us> <97b451228227c555be1a4f79c4a62ddec9a74f06.camel@j-davis.com> <6af48508a32499a8be3398cafffd29fb6188c44b.camel@j-davis.com> <57988cee-5cc8-44f9-981e-8d62e556f5c8@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Sat, 01 Mar 2025 19:00:00 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3043075.1740852261.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 01 Mar 2025 13:04:21 -0500 Message-ID: <3043076.1740852261@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Lakhin writes: > It looks like 8f427187d broke pg_dump on Cygwin: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dfairywren&dt=3D= 2025-02-26%2010%3A03%3A07 Yeah, Andrew and I have been puzzling over that off-list. pg_dump is definitely exiting unceremoniously. > As far as I can see, it exits prematurely here: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 float=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 reltuples =3D strtof(PQgetvalue(res, i, i_reltuples), NULL); I was suspecting those float conversions as a likely cause, but what do you think is wrong exactly? I see nothing obviously buggy in pg_strtof(). But I'm not sure it's worth running to ground. I don't love any of the portability-related hacks that 8f427187d made: the setlocale() call looks like something with an undesirably large blast radius, and pg_dump has never made use of strtof or f2s.c before. Sure, those *ought* to work, but they evidently don't work everywhere, and I don't especially want to expend more brain cells figuring out what's wrong here. I think we ought to cut our losses and store reltuples in string form, as Corey wanted to do originally. regards, tom lane