Thread: pgsql: Remove redundant pg_set_*_stats() variants.

pgsql: Remove redundant pg_set_*_stats() variants.

From
Jeff Davis
Date:
Remove redundant pg_set_*_stats() variants.

After commit f3dae2ae58, the primary purpose of separating the
pg_set_*_stats() from the pg_restore_*_stats() variants was
eliminated.

Leave pg_restore_relation_stats() and pg_restore_attribute_stats(),
which satisfy both purposes, and remove pg_set_relation_stats() and
pg_set_attribute_stats().

Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
Discussion: https://postgr.es/m/1457469.1740419458@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a5cbdeb98af9a8d4f683fbffa69cd74be1f4a084

Modified Files
--------------
doc/src/sgml/func.sgml                     |  254 +++---
src/backend/catalog/system_functions.sql   |   32 -
src/backend/statistics/attribute_stats.c   |   98 +-
src/backend/statistics/relation_stats.c    |   24 +-
src/backend/statistics/stat_utils.c        |   30 +-
src/include/catalog/catversion.h           |    2 +-
src/include/catalog/pg_proc.dat            |   32 +-
src/include/statistics/stat_utils.h        |    8 +-
src/test/regress/expected/stats_import.out | 1339 ++++++++--------------------
src/test/regress/sql/stats_import.sql      | 1075 +++++++---------------
10 files changed, 872 insertions(+), 2022 deletions(-)


Re: pgsql: Remove redundant pg_set_*_stats() variants.

From
Michael Paquier
Date:
Hi Jeff,

On Wed, Feb 26, 2025 at 12:17:03AM +0000, Jeff Davis wrote:
> Remove redundant pg_set_*_stats() variants.
>
> After commit f3dae2ae58, the primary purpose of separating the
> pg_set_*_stats() from the pg_restore_*_stats() variants was
> eliminated.
>
> Leave pg_restore_relation_stats() and pg_restore_attribute_stats(),
> which satisfy both purposes, and remove pg_set_relation_stats() and
> pg_set_attribute_stats().
>
> Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
> Discussion: https://postgr.es/m/1457469.1740419458@sss.pgh.pa.us

I assume that you did not want to do that at the top of pg_proc.dat:
-#----------------------------------------------------------------------
+\#----------------------------------------------------------------------
--
Michael

Attachment