aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-09-29 15:29:45 +0900
committerMichael Paquier <michael@paquier.xyz>2021-09-29 15:29:45 +0900
commit2cf9cf5d7b5e66202389618a4c08945da352b35c (patch)
tree3e7f6d201f5caaaa736fd983bc5fcf9713a2562a /src/backend/commands
parent2a27dbaeb9088718baa25bc97f2e049e063412db (diff)
downloadpostgresql-2cf9cf5d7b5e66202389618a4c08945da352b35c.tar.gz
postgresql-2cf9cf5d7b5e66202389618a4c08945da352b35c.zip
Clarify use of "statistics objects" in the code
The code inconsistently used "statistic object" or "statistics" where the correct term, as discussed, is actually "statistics object". This improves the state of the code to be more consistent. While on it, fix an incorrect error message introduced in a4d75c8. This error should never happen, as the code states, but it would be misleading. Author: Justin Pryzby Reviewed-by: Álvaro Herrera, Michael Paquier Discussion: https://postgr.es/m/20210924215827.GS831@telsasoft.com Backpatch-through: 14
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/statscmds.c28
-rw-r--r--src/backend/commands/tablecmds.c8
2 files changed, 18 insertions, 18 deletions
diff --git a/src/backend/commands/statscmds.c b/src/backend/commands/statscmds.c
index c4b9bd29ec9..edc4c481043 100644
--- a/src/backend/commands/statscmds.c
+++ b/src/backend/commands/statscmds.c
@@ -559,11 +559,11 @@ CreateStatistics(CreateStatsStmt *stmt)
}
/*
- * If there are no dependencies on a column, give the statistics an auto
- * dependency on the whole table. In most cases, this will be redundant,
- * but it might not be if the statistics expressions contain no Vars
- * (which might seem strange but possible). This is consistent with what
- * we do for indexes in index_create.
+ * If there are no dependencies on a column, give the statistics object an
+ * auto dependency on the whole table. In most cases, this will be
+ * redundant, but it might not be if the statistics expressions contain no
+ * Vars (which might seem strange but possible). This is consistent with
+ * what we do for indexes in index_create.
*
* XXX We intentionally don't consider the expressions before adding this
* dependency, because recordDependencyOnSingleRelExpr may not create any
@@ -648,9 +648,9 @@ AlterStatistics(AlterStatsStmt *stmt)
stxoid = get_statistics_object_oid(stmt->defnames, stmt->missing_ok);
/*
- * If we got here and the OID is not valid, it means the statistics does
- * not exist, but the command specified IF EXISTS. So report this as a
- * simple NOTICE and we're done.
+ * If we got here and the OID is not valid, it means the statistics object
+ * does not exist, but the command specified IF EXISTS. So report this as
+ * a simple NOTICE and we're done.
*/
if (!OidIsValid(stxoid))
{
@@ -767,7 +767,7 @@ RemoveStatisticsById(Oid statsOid)
}
/*
- * Select a nonconflicting name for a new statistics.
+ * Select a nonconflicting name for a new statistics object.
*
* name1, name2, and label are used the same way as for makeObjectName(),
* except that the label can't be NULL; digits will be appended to the label
@@ -814,9 +814,9 @@ ChooseExtendedStatisticName(const char *name1, const char *name2,
}
/*
- * Generate "name2" for a new statistics given the list of column names for it
- * This will be passed to ChooseExtendedStatisticName along with the parent
- * table name and a suitable label.
+ * Generate "name2" for a new statistics object given the list of column
+ * names for it. This will be passed to ChooseExtendedStatisticName along
+ * with the parent table name and a suitable label.
*
* We know that less than NAMEDATALEN characters will actually be used,
* so we can truncate the result once we've generated that many.
@@ -868,8 +868,8 @@ ChooseExtendedStatisticNameAddition(List *exprs)
}
/*
- * StatisticsGetRelation: given a statistics's relation OID, get the OID of
- * the relation it is an statistics on. Uses the system cache.
+ * StatisticsGetRelation: given a statistics object's OID, get the OID of
+ * the relation it is defined on. Uses the system cache.
*/
Oid
StatisticsGetRelation(Oid statId, bool missing_ok)
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 36df38b0f8d..762f431ab88 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -12465,13 +12465,13 @@ RememberStatisticsForRebuilding(Oid stxoid, AlteredTableInfo *tab)
/*
* This de-duplication check is critical for two independent reasons: we
* mustn't try to recreate the same statistics object twice, and if the
- * statistics depends on more than one column whose type is to be altered,
- * we must capture its definition string before applying any of the type
- * changes. ruleutils.c will get confused if we ask again later.
+ * statistics object depends on more than one column whose type is to be
+ * altered, we must capture its definition string before applying any of
+ * the type changes. ruleutils.c will get confused if we ask again later.
*/
if (!list_member_oid(tab->changedStatisticsOids, stxoid))
{
- /* OK, capture the index's existing definition string */
+ /* OK, capture the statistics object's existing definition string */
char *defstring = pg_get_statisticsobjdef_string(stxoid);
tab->changedStatisticsOids = lappend_oid(tab->changedStatisticsOids,