From c95cc2d44e98847695aba94ea04a44906ebf5d51 Mon Sep 17 00:00:00 2001
From: Corey Huinker <corey.huinker@gmail.com>
Date: Mon, 22 Jun 2026 14:16:31 -0400
Subject: [PATCH v2 6/7] Rename attribute_statistics functions.

The static attribute_statistics_update() is now update_attstats(). The
function import_attribute_stats() is now attribute_statisticss_update()
and delete_attribute_statistics() is now attribute_statistics_delete().

Changes to function signatures will happen in a later patch.
---
 src/include/statistics/attribute_stats.h |  4 ++--
 src/backend/statistics/attribute_stats.c | 14 +++++++-------
 contrib/postgres_fdw/postgres_fdw.c      |  4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/include/statistics/attribute_stats.h b/src/include/statistics/attribute_stats.h
index 4ebde0c7c3b..8a4ee5112e4 100644
--- a/src/include/statistics/attribute_stats.h
+++ b/src/include/statistics/attribute_stats.h
@@ -15,9 +15,9 @@
 #include "access/genam.h"
 
 
-bool delete_attribute_statistics(Relation rel, AttrNumber attnum, bool inherited);
+bool attribute_statistics_delete(Relation rel, AttrNumber attnum, bool inherited);
 
-bool import_attribute_statistics(Relation rel, const char *attname,
+bool attribute_statistics_update(Relation rel, const char *attname,
 								 AttrNumber attnum, bool inherited,
 								 const char *null_frac, const char *avg_width,
 								 const char *n_distinct,
diff --git a/src/backend/statistics/attribute_stats.c b/src/backend/statistics/attribute_stats.c
index f67d62c0104..7dccce83c65 100644
--- a/src/backend/statistics/attribute_stats.c
+++ b/src/backend/statistics/attribute_stats.c
@@ -34,7 +34,7 @@
 
 /*
  * Positional argument numbers, names, and types for
- * attribute_statistics_update() and pg_restore_attribute_stats().
+ * update_attstats() and pg_restore_attribute_stats().
  */
 
 enum attribute_stats_argnum
@@ -106,7 +106,7 @@ static struct StatsArgInfo cleararginfo[] =
 	[C_NUM_ATTRIBUTE_STATS_ARGS] = {0}
 };
 
-static bool attribute_statistics_update(FunctionCallInfo fcinfo);
+static bool update_attstats(FunctionCallInfo fcinfo);
 static void upsert_pg_statistic(Relation starel, HeapTuple oldtup,
 								const Datum *values, const bool *nulls, const bool *replaces);
 static bool delete_pg_statistic(Oid reloid, AttrNumber attnum, bool stainherit);
@@ -128,7 +128,7 @@ static bool delete_pg_statistic(Oid reloid, AttrNumber attnum, bool stainherit);
  * and other statistic kinds may still be updated.
  */
 static bool
-attribute_statistics_update(FunctionCallInfo fcinfo)
+update_attstats(FunctionCallInfo fcinfo)
 {
 	char	   *nspname;
 	char	   *relname;
@@ -685,7 +685,7 @@ pg_restore_attribute_stats(PG_FUNCTION_ARGS)
 										  attarginfo))
 		result = false;
 
-	if (!attribute_statistics_update(positional_fcinfo))
+	if (!update_attstats(positional_fcinfo))
 		result = false;
 
 	PG_RETURN_BOOL(result);
@@ -808,7 +808,7 @@ set_floatarr_arg(NullableDatum *arg, const char *s)
  * Delete attribute statistics.
  */
 bool
-delete_attribute_statistics(Relation rel, AttrNumber attnum, bool inherited)
+attribute_statistics_delete(Relation rel, AttrNumber attnum, bool inherited)
 {
 	return delete_pg_statistic(RelationGetRelid(rel), attnum, inherited);
 }
@@ -820,7 +820,7 @@ delete_attribute_statistics(Relation rel, AttrNumber attnum, bool inherited)
  * To convey a "null"/not-set value for attnum, use InvalidAttrNumber.
  */
 bool
-import_attribute_statistics(Relation rel, const char *attname,
+attribute_statistics_update(Relation rel, const char *attname,
 							AttrNumber attnum, bool inherited,
 							const char *null_frac, const char *avg_width,
 							const char *n_distinct,
@@ -878,5 +878,5 @@ import_attribute_statistics(Relation rel, const char *attname,
 	set_float_arg(&newfcinfo->args[RANGE_EMPTY_FRAC_ARG], range_empty_frac);
 	set_text_arg(&newfcinfo->args[RANGE_BOUNDS_HISTOGRAM_ARG], range_bounds_histogram);
 
-	return attribute_statistics_update(newfcinfo);
+	return update_attstats(newfcinfo);
 }
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 1d203f5fcf5..9680af902ca 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -6048,9 +6048,9 @@ import_fetched_statistics(Relation relation,
 			 */
 			CHECK_FOR_INTERRUPTS();
 
-			delete_attribute_statistics(relation, attnum, false);
+			attribute_statistics_delete(relation, attnum, false);
 
-			if (!import_attribute_statistics(relation, attname,
+			if (!attribute_statistics_update(relation, attname,
 											 InvalidAttrNumber,
 											 false,
 											 get_opt_value(res, row, ATTSTATS_NULL_FRAC),
-- 
2.54.0

