]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Rename cluster.c to repack.c (and corresponding .h)
authorÁlvaro Herrera <alvherre@kurilemu.de>
Mon, 6 Apr 2026 17:37:28 +0000 (19:37 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Mon, 6 Apr 2026 18:11:01 +0000 (20:11 +0200)
CLUSTER is no longer the favored way to invoke this functionality, and
the code is about to shift its focus to the REPACK more ambitiously.
Rename the file to avoid leaving an unnecessary historical artifact
around.

Author: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/202603271635.owyhm7btgoic@alvherre.pgsql

src/backend/commands/Makefile
src/backend/commands/matview.c
src/backend/commands/meson.build
src/backend/commands/repack.c [moved from src/backend/commands/cluster.c with 99% similarity]
src/backend/commands/tablecmds.c
src/backend/commands/vacuum.c
src/backend/storage/ipc/procsignal.c
src/backend/tcop/postgres.c
src/backend/tcop/utility.c
src/include/commands/repack.h [moved from src/include/commands/cluster.h with 90% similarity]

index c10fdba2bbb019f66a4cbb2f3ab22e263d212a2b..fe1bba3a9b93c647b6b424f0da6dafbecb732bfd 100644 (file)
@@ -18,7 +18,6 @@ OBJS = \
        amcmds.o \
        analyze.o \
        async.o \
-       cluster.o \
        collationcmds.o \
        comment.o \
        constraint.o \
@@ -51,6 +50,7 @@ OBJS = \
        proclang.o \
        propgraphcmds.o \
        publicationcmds.o \
+       repack.o \
        schemacmds.o \
        seclabel.o \
        sequence.o \
index d3be8939011be951adf1475f68a43f5dbfd6f2fe..5db4fe75dcecdd83b561e0aad483fd48e84741ea 100644 (file)
@@ -24,8 +24,8 @@
 #include "catalog/namespace.h"
 #include "catalog/pg_am.h"
 #include "catalog/pg_opclass.h"
-#include "commands/cluster.h"
 #include "commands/matview.h"
+#include "commands/repack.h"
 #include "commands/tablecmds.h"
 #include "commands/tablespace.h"
 #include "executor/executor.h"
index 90c7e37a42991af191791af87e1216d5da1c26fc..f624aae74af5a7143ae9e49f7ec66531b2b060aa 100644 (file)
@@ -6,7 +6,6 @@ backend_sources += files(
   'amcmds.c',
   'analyze.c',
   'async.c',
-  'cluster.c',
   'collationcmds.c',
   'comment.c',
   'constraint.c',
@@ -39,6 +38,7 @@ backend_sources += files(
   'proclang.c',
   'propgraphcmds.c',
   'publicationcmds.c',
+  'repack.c',
   'schemacmds.c',
   'seclabel.c',
   'sequence.c',
similarity index 99%
rename from src/backend/commands/cluster.c
rename to src/backend/commands/repack.c
index f241e18b1531a00a17ab3238f70ae1717838de1a..20f0a572236151081f2368f554ef3f162af4fd59 100644 (file)
@@ -1,6 +1,6 @@
 /*-------------------------------------------------------------------------
  *
- * cluster.c
+ * repack.c
  *    REPACK a table; formerly known as CLUSTER.  VACUUM FULL also uses
  *    parts of this code.
  *
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *       src/backend/commands/cluster.c
+ *       src/backend/commands/repack.c
  *
  *-------------------------------------------------------------------------
  */
@@ -33,9 +33,9 @@
 #include "catalog/pg_am.h"
 #include "catalog/pg_inherits.h"
 #include "catalog/toasting.h"
-#include "commands/cluster.h"
 #include "commands/defrem.h"
 #include "commands/progress.h"
+#include "commands/repack.h"
 #include "commands/tablecmds.h"
 #include "commands/vacuum.h"
 #include "miscadmin.h"
index 0ce2e81f9c2f2c26f20f01ad72ad9b8b0f55f93a..e2882a50b3b724720665731865554560a3877e23 100644 (file)
 #include "catalog/storage.h"
 #include "catalog/storage_xlog.h"
 #include "catalog/toasting.h"
-#include "commands/cluster.h"
 #include "commands/comment.h"
 #include "commands/defrem.h"
 #include "commands/event_trigger.h"
+#include "commands/repack.h"
 #include "commands/sequence.h"
 #include "commands/tablecmds.h"
 #include "commands/tablespace.h"
index 0ed363d1c85afd4d44505cef4ce30c9e1396a301..b179b62b5c8359e802da5916b86aa92c0b8d0ee2 100644 (file)
@@ -9,7 +9,7 @@
  *
  * VACUUM for heap AM is implemented in vacuumlazy.c, parallel vacuum in
  * vacuumparallel.c, ANALYZE in analyze.c, and VACUUM FULL is a variant of
- * CLUSTER, handled in cluster.c.
+ * REPACK, handled in repack.c.
  *
  *
  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
@@ -38,9 +38,9 @@
 #include "catalog/pg_database.h"
 #include "catalog/pg_inherits.h"
 #include "commands/async.h"
-#include "commands/cluster.h"
 #include "commands/defrem.h"
 #include "commands/progress.h"
+#include "commands/repack.h"
 #include "commands/vacuum.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
@@ -2293,7 +2293,7 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams params,
                        if ((params.options & VACOPT_VERBOSE) != 0)
                                cluster_params.options |= CLUOPT_VERBOSE;
 
-                       /* VACUUM FULL is a variant of REPACK; see cluster.c */
+                       /* VACUUM FULL is a variant of REPACK; see repack.c */
                        cluster_rel(REPACK_COMMAND_VACUUMFULL, rel, InvalidOid,
                                                &cluster_params);
                        /* cluster_rel closes the relation, but keeps lock */
index adebf0e78987b1d3c88575cc9ab35289c273fc21..3c44a2fd082a56c2e9fc9c6716449cb745456d01 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "access/parallel.h"
 #include "commands/async.h"
+#include "commands/repack.h"
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "port/pg_bitutils.h"
index 95496654714d78631cf0a7d209c9c00fd5112a5f..808aa145b352e59cceee95eee0b38cbca7fde2f2 100644 (file)
@@ -39,6 +39,7 @@
 #include "commands/event_trigger.h"
 #include "commands/explain_state.h"
 #include "commands/prepare.h"
+#include "commands/repack.h"
 #include "common/pg_prng.h"
 #include "jit/jit.h"
 #include "libpq/libpq.h"
index 2b609bfc824b1ab4e70e529172b6b7bd4ca1805f..5f8c766c4be2134fe47017c0ff2b5ca294161ca0 100644 (file)
@@ -26,7 +26,6 @@
 #include "catalog/toasting.h"
 #include "commands/alter.h"
 #include "commands/async.h"
-#include "commands/cluster.h"
 #include "commands/collationcmds.h"
 #include "commands/comment.h"
 #include "commands/conversioncmds.h"
@@ -46,6 +45,7 @@
 #include "commands/proclang.h"
 #include "commands/propgraphcmds.h"
 #include "commands/publicationcmds.h"
+#include "commands/repack.h"
 #include "commands/schemacmds.h"
 #include "commands/seclabel.h"
 #include "commands/sequence.h"
similarity index 90%
rename from src/include/commands/cluster.h
rename to src/include/commands/repack.h
index d6b62c747e8db864d5d0769a618d8d410106812b..85061158b0c8c6bb7f9ca39777607d655142cec3 100644 (file)
@@ -1,17 +1,17 @@
 /*-------------------------------------------------------------------------
  *
- * cluster.h
- *       header file for postgres cluster command stuff
+ * repack.h
+ *       header file for the REPACK command
  *
  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994-5, Regents of the University of California
  *
- * src/include/commands/cluster.h
+ * src/include/commands/repack.h
  *
  *-------------------------------------------------------------------------
  */
-#ifndef CLUSTER_H
-#define CLUSTER_H
+#ifndef REPACK_H
+#define REPACK_H
 
 #include "nodes/parsenodes.h"
 #include "parser/parse_node.h"
@@ -52,4 +52,4 @@ extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
                                                         MultiXactId cutoffMulti,
                                                         char newrelpersistence);
 
-#endif                                                 /* CLUSTER_H */
+#endif                                                 /* REPACK_H */