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

From Tom Lane
Subject Re: Statistics Import and Export
Date
Msg-id 3049348.1740855411@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:
> 01.03.2025 20:04, Tom Lane wrote:
>> 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().

>  From my understanding, pg_strtof () can't stand against endptr == NULL.

D'oh!  I'm blind as a bat today.

> I have changed that line to:
>          char *tptr;
>          float        reltuples = strtof(PQgetvalue(res, i, i_reltuples), &tptr);
> and 002_compare_backups passed for me.

Cool, but surely the right fix is to make pg_strtof() adhere to
the POSIX specification, so we don't have to learn this lesson
again elsewhere.  I'll go make it so.

Independently of that, do we want to switch over to storing
reltuples as a string instead of converting it?  I still feel
uncomfortable about the amount of baggage we added to pg_dump
to avoid that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Greg Sabino Mullane
Date:
Subject: Re: Statistics Import and Export
Next
From: Ed Behn
Date:
Subject: Re: access numeric data in module