diff options
author | Michael Paquier <michael@paquier.xyz> | 2025-06-30 15:42:50 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2025-06-30 15:42:50 +0900 |
commit | 2252fcd4276cfeabae8786ab7c5a421dd674743e (patch) | |
tree | c1cb02406275c70361ca799ef2f8c304fa7637e7 /src/backend/commands/cluster.c | |
parent | 5ba00e175a4eaefa4dc38ea14c667bbeb13af305 (diff) | |
download | postgresql-2252fcd4276cfeabae8786ab7c5a421dd674743e.tar.gz postgresql-2252fcd4276cfeabae8786ab7c5a421dd674743e.zip |
Rationalize handling of VacuumParams
This commit refactors the vacuum routines that rely on VacuumParams,
adding const markers where necessary to force a new policy in the code.
This structure should not use a pointer as it may be used across
multiple relations, and its contents should never be updated.
vacuum_rel() stands as an exception as it touches the "index_cleanup"
and "truncate" options.
VacuumParams has been introduced in 0d831389749a, and 661643dedad9 has
fixed a bug impacting VACUUM operating on multiple relations. The
changes done in tableam.h break ABI compatibility, so this commit can
only happen on HEAD.
Author: Shihao Zhong <zhong950419@gmail.com>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://postgr.es/m/CAGRkXqTo+aK=GTy5pSc-9cy8H2F2TJvcrZ-zXEiNJj93np1UUw@mail.gmail.com
Diffstat (limited to 'src/backend/commands/cluster.c')
-rw-r--r-- | src/backend/commands/cluster.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index 54a08e4102e..b55221d44cd 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -917,7 +917,7 @@ copy_table_data(Relation NewHeap, Relation OldHeap, Relation OldIndex, bool verb * not to be aggressive about this. */ memset(¶ms, 0, sizeof(VacuumParams)); - vacuum_get_cutoffs(OldHeap, ¶ms, &cutoffs); + vacuum_get_cutoffs(OldHeap, params, &cutoffs); /* * FreezeXid will become the table's new relfrozenxid, and that mustn't go |