From: Alexander Korotkov <akorotkov@postgresql.org>
Date: Wed, 3 Apr 2024 18:29:18 +0000 (+0300)
Subject: Fix the parameters order for TableAmRoutine.relation_copy_for_cluster()
X-Git-Tag: REL_13_15~29
X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=68044d15b737fe567c9c2e00a1c8466530ed02ce;p=postgresql.git

Fix the parameters order for TableAmRoutine.relation_copy_for_cluster()

Specify OldTable first, NewTable second as used by
table_relation_copy_for_cluster() and as implemented in
heapam_relation_copy_for_cluster().

Backpatch to PostgreSQL 12, where TableAmRoutine was introduced.

Discussion: https://postgr.es/m/ME3P282MB3166860D4911AE82F92DF7C5B63F2%40ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM
Author: Japin Li
Reviewed-by: Pavel Borisov
Backpatch-through: 12
---

diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index 15bb99d1a36..77f43930cf1 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -470,8 +470,8 @@ typedef struct TableAmRoutine
 									   const RelFileNode *newrnode);
 
 	/* See table_relation_copy_for_cluster() */
-	void		(*relation_copy_for_cluster) (Relation NewTable,
-											  Relation OldTable,
+	void		(*relation_copy_for_cluster) (Relation OldTable,
+											  Relation NewTable,
 											  Relation OldIndex,
 											  bool use_sort,
 											  TransactionId OldestXmin,