Re: Statistics Import and Export - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Statistics Import and Export
Date
Msg-id 3043076.1740852261@sss.pgh.pa.us
Whole thread Raw
In response to Re: Statistics Import and Export  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: Statistics Import and Export
List pgsql-hackers
Alexander Lakhin <exclusion@gmail.com> writes:
> It looks like 8f427187d broke pg_dump on Cygwin:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=fairywren&dt=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:
>                 float           reltuples = 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



pgsql-hackers by date:

Previous
From: Doruk Yilmaz
Date:
Subject: Re: [Patch] add new parameter to pg_replication_origin_session_setup
Next
From: Alexander Lakhin
Date:
Subject: Re: Statistics Import and Export