From: | Jeff Davis <jdavis(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Don't convert to and from floats in pg_dump. |
Date: | 2025-03-08 19:26:36 |
Message-ID: | E1tqzoi-001T7t-2R@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Don't convert to and from floats in pg_dump.
Commit 8f427187db improved performance by remembering relation stats
as native types rather than issuing a new query for each relation.
Using native types is fine for integers like relpages; but reltuples
is floating point. The commit controllled for that complexity by using
setlocale(LC_NUMERIC, "C"). After that, Alexander Lakhin found a
problem in pg_strtof(), fixed in 00d61a08c5.
While we aren't aware of any more problems with that approach, it
seems wise to just use a string the whole way for floating point
values, as Corey's original patch did, and get rid of the
setlocale(). Integers are still converted to native types to avoid
wasting memory.
Co-authored-by: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Discussion: https://postgr.es/m/3049348.1740855411@sss.pgh.pa.us
Discussion: https://postgr.es/m/560cca3781740bd69881bb07e26eb8f65b09792c.camel%40j-davis.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/1852aea3f526b124b95585f7b1f655f3af04afd5
Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 22 +++++++++-------------
src/bin/pg_dump/pg_dump.h | 2 +-
2 files changed, 10 insertions(+), 14 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Nathan Bossart | 2025-03-08 20:29:30 | pgsql: doc: Adjust note about pg_upgrade's --jobs option. |
Previous Message | Tom Lane | 2025-03-08 16:25:16 | pgsql: Clear errno before calling strtol() in spell.c. |