Hi,

On Thu, Nov 27, 2025 at 03:07:17PM +0300, Nazir Bilal Yavuz wrote:
> On Thu, 27 Nov 2025 at 11:57, Bertrand Drouvot
> <[email protected]> wrote:
> >
> > The patches are split by modules to ease the review.
> 
> I applied all patches and built/tested without any errors. So I guess
> that the changes are correct.

Thanks for looking at it!

> I skimmed through 0001-0003 to see if I can find more parameters to
> delete and found that we can remove the 'tinfo' parameter from the
> gbt_var_node_truncate() function.

Yeah, also found it with an improved version of the coccinelle script. Also
there is one more in postgres_fdw: unused rte parameter in 
create_foreign_modify()
is oversight in commit a61b1f74823.

And also one in pg_walinspect.

All added in the attached.

> > For 0005 (collid not used in internal_citext_pattern_cmp()) I think that the
> > unused column should be used (as done in 0005) due to an oversight in commit
> > f2464997644c.
> 
> I do not have a context on this but there is a comment in the
> citextcmp() function, which might be related to this context:
> 
>     /*
>      * We must do our str_tolower calls with DEFAULT_COLLATION_OID, not the
>      * input collation as you might expect.  This is so that the behavior of
>      * citext's equality and hashing functions is not collation-dependent.  We
>      * should change this once the core infrastructure is able to cope with
>      * collation-dependent equality and hashing functions.
>      */

Interesting... So maybe we should just remove collid in
internal_citext_pattern_cmp() instead: that's what 0005 is now doing.

Tha said, I'm not familiar with this code area, so better to wait other 
feedbacks
for 0005 then.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
>From ea5cd89ce1563b7da544577a2ba77852476f49b3 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <[email protected]>
Date: Thu, 27 Nov 2025 07:01:02 +0000
Subject: [PATCH v2 1/6] Removing unused function parameters in btree_gist

A few parameters are not used, let's remove them.
---
 contrib/btree_gist/btree_utils_var.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
 100.0% contrib/btree_gist/

diff --git a/contrib/btree_gist/btree_utils_var.c b/contrib/btree_gist/btree_utils_var.c
index fb466e5aa32..a657ad78d30 100644
--- a/contrib/btree_gist/btree_utils_var.c
+++ b/contrib/btree_gist/btree_utils_var.c
@@ -166,7 +166,7 @@ gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)
  * returns true, if query matches prefix ( common prefix )
  */
 static bool
-gbt_bytea_pf_match(const bytea *pf, const bytea *query, const gbtree_vinfo *tinfo)
+gbt_bytea_pf_match(const bytea *pf, const bytea *query)
 {
 	bool		out = false;
 	int32		qlen = VARSIZE(query) - VARHDRSZ;
@@ -191,8 +191,8 @@ static bool
 gbt_var_node_pf_match(const GBT_VARKEY_R *node, const bytea *query, const gbtree_vinfo *tinfo)
 {
 	return (tinfo->trnc &&
-			(gbt_bytea_pf_match(node->lower, query, tinfo) ||
-			 gbt_bytea_pf_match(node->upper, query, tinfo)));
+			(gbt_bytea_pf_match(node->lower, query) ||
+			 gbt_bytea_pf_match(node->upper, query)));
 }
 
 
@@ -201,7 +201,7 @@ gbt_var_node_pf_match(const GBT_VARKEY_R *node, const bytea *query, const gbtree
 *  cpf_length .. common prefix length
 */
 static GBT_VARKEY *
-gbt_var_node_truncate(const GBT_VARKEY *node, int32 cpf_length, const gbtree_vinfo *tinfo)
+gbt_var_node_truncate(const GBT_VARKEY *node, int32 cpf_length)
 {
 	GBT_VARKEY *out = NULL;
 	GBT_VARKEY_R r = gbt_var_key_readable(node);
@@ -348,7 +348,7 @@ gbt_var_union(const GistEntryVector *entryvec, int32 *size, Oid collation,
 		GBT_VARKEY *trc = NULL;
 
 		plen = gbt_var_node_cp_len((GBT_VARKEY *) DatumGetPointer(out), tinfo);
-		trc = gbt_var_node_truncate((GBT_VARKEY *) DatumGetPointer(out), plen + 1, tinfo);
+		trc = gbt_var_node_truncate((GBT_VARKEY *) DatumGetPointer(out), plen + 1);
 
 		out = PointerGetDatum(trc);
 	}
@@ -399,9 +399,9 @@ gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n,
 	if ((VARSIZE(ok.lower) - VARHDRSZ) == 0 && (VARSIZE(ok.upper) - VARHDRSZ) == 0)
 		*res = 0.0;
 	else if (!((tinfo->f_cmp(nk.lower, ok.lower, collation, flinfo) >= 0 ||
-				gbt_bytea_pf_match(ok.lower, nk.lower, tinfo)) &&
+				gbt_bytea_pf_match(ok.lower, nk.lower)) &&
 			   (tinfo->f_cmp(nk.upper, ok.upper, collation, flinfo) <= 0 ||
-				gbt_bytea_pf_match(ok.upper, nk.upper, tinfo))))
+				gbt_bytea_pf_match(ok.upper, nk.upper))))
 	{
 		Datum		d = PointerGetDatum(0);
 		double		dres;
@@ -537,8 +537,8 @@ gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
 		ll = Max(ll, lr);
 		ll++;
 
-		dl = gbt_var_node_truncate((GBT_VARKEY *) DatumGetPointer(v->spl_ldatum), ll, tinfo);
-		dr = gbt_var_node_truncate((GBT_VARKEY *) DatumGetPointer(v->spl_rdatum), ll, tinfo);
+		dl = gbt_var_node_truncate((GBT_VARKEY *) DatumGetPointer(v->spl_ldatum), ll);
+		dr = gbt_var_node_truncate((GBT_VARKEY *) DatumGetPointer(v->spl_rdatum), ll);
 		v->spl_ldatum = PointerGetDatum(dl);
 		v->spl_rdatum = PointerGetDatum(dr);
 	}
-- 
2.34.1

>From c5fe519e57279645281e6fad7642c031f341dcfc Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <[email protected]>
Date: Thu, 27 Nov 2025 07:19:20 +0000
Subject: [PATCH v2 2/6] Removing unused function parameters in pgcrypto

A few parameters are not used, let's remove them.
---
 contrib/pgcrypto/pgcrypto.c  | 19 ++++++++-----------
 contrib/pgcrypto/pgp-pgsql.c |  4 ++--
 2 files changed, 10 insertions(+), 13 deletions(-)
 100.0% contrib/pgcrypto/

diff --git a/contrib/pgcrypto/pgcrypto.c b/contrib/pgcrypto/pgcrypto.c
index 9ecbbd2e2f8..5b762107e2e 100644
--- a/contrib/pgcrypto/pgcrypto.c
+++ b/contrib/pgcrypto/pgcrypto.c
@@ -56,8 +56,7 @@ static const struct config_enum_entry builtin_crypto_options[] = {
 };
 
 typedef int (*PFN) (const char *name, void **res);
-static void *find_provider(text *name, PFN provider_lookup, const char *desc,
-						   int silent);
+static void *find_provider(text *name, PFN provider_lookup, int silent);
 
 int			builtin_crypto_enabled = BC_ON;
 
@@ -98,7 +97,7 @@ pg_digest(PG_FUNCTION_ARGS)
 	name = PG_GETARG_TEXT_PP(1);
 
 	/* will give error if fails */
-	md = find_provider(name, (PFN) px_find_digest, "Digest", 0);
+	md = find_provider(name, (PFN) px_find_digest, 0);
 
 	hlen = px_md_result_size(md);
 
@@ -136,7 +135,7 @@ pg_hmac(PG_FUNCTION_ARGS)
 	name = PG_GETARG_TEXT_PP(2);
 
 	/* will give error if fails */
-	h = find_provider(name, (PFN) px_find_hmac, "HMAC", 0);
+	h = find_provider(name, (PFN) px_find_hmac, 0);
 
 	hlen = px_hmac_result_size(h);
 
@@ -262,7 +261,7 @@ pg_encrypt(PG_FUNCTION_ARGS)
 				rlen;
 
 	type = PG_GETARG_TEXT_PP(2);
-	c = find_provider(type, (PFN) px_find_combo, "Cipher", 0);
+	c = find_provider(type, (PFN) px_find_combo, 0);
 
 	data = PG_GETARG_BYTEA_PP(0);
 	key = PG_GETARG_BYTEA_PP(1);
@@ -311,7 +310,7 @@ pg_decrypt(PG_FUNCTION_ARGS)
 				rlen;
 
 	type = PG_GETARG_TEXT_PP(2);
-	c = find_provider(type, (PFN) px_find_combo, "Cipher", 0);
+	c = find_provider(type, (PFN) px_find_combo, 0);
 
 	data = PG_GETARG_BYTEA_PP(0);
 	key = PG_GETARG_BYTEA_PP(1);
@@ -361,7 +360,7 @@ pg_encrypt_iv(PG_FUNCTION_ARGS)
 				rlen;
 
 	type = PG_GETARG_TEXT_PP(3);
-	c = find_provider(type, (PFN) px_find_combo, "Cipher", 0);
+	c = find_provider(type, (PFN) px_find_combo, 0);
 
 	data = PG_GETARG_BYTEA_PP(0);
 	key = PG_GETARG_BYTEA_PP(1);
@@ -415,7 +414,7 @@ pg_decrypt_iv(PG_FUNCTION_ARGS)
 				ivlen;
 
 	type = PG_GETARG_TEXT_PP(3);
-	c = find_provider(type, (PFN) px_find_combo, "Cipher", 0);
+	c = find_provider(type, (PFN) px_find_combo, 0);
 
 	data = PG_GETARG_BYTEA_PP(0);
 	key = PG_GETARG_BYTEA_PP(1);
@@ -493,9 +492,7 @@ pg_check_fipsmode(PG_FUNCTION_ARGS)
 }
 
 static void *
-find_provider(text *name,
-			  PFN provider_lookup,
-			  const char *desc, int silent)
+find_provider(text *name, PFN provider_lookup, int silent)
 {
 	void	   *res;
 	char	   *buf;
diff --git a/contrib/pgcrypto/pgp-pgsql.c b/contrib/pgcrypto/pgp-pgsql.c
index 7c9f4c7b39b..583d4ae17d2 100644
--- a/contrib/pgcrypto/pgp-pgsql.c
+++ b/contrib/pgcrypto/pgp-pgsql.c
@@ -119,7 +119,7 @@ struct debug_expect
 };
 
 static void
-fill_expect(struct debug_expect *ex, int text_mode)
+fill_expect(struct debug_expect *ex)
 {
 	ex->debug = 0;
 	ex->expect = 0;
@@ -353,7 +353,7 @@ init_work(PGP_Context **ctx_p, int is_text,
 {
 	int			err = pgp_init(ctx_p);
 
-	fill_expect(ex, is_text);
+	fill_expect(ex);
 
 	if (err == 0 && args != NULL)
 		err = parse_args(*ctx_p, (uint8 *) VARDATA_ANY(args),
-- 
2.34.1

>From 95682e77780f6807107431c77ef285283273fb87 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <[email protected]>
Date: Thu, 27 Nov 2025 07:22:10 +0000
Subject: [PATCH v2 3/6] Removing unused function parameters in file_fdw

A few parameters are not used, let's remove them.
---
 contrib/file_fdw/file_fdw.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
 100.0% contrib/file_fdw/

diff --git a/contrib/file_fdw/file_fdw.c b/contrib/file_fdw/file_fdw.c
index 70564a68b13..7638bce6262 100644
--- a/contrib/file_fdw/file_fdw.c
+++ b/contrib/file_fdw/file_fdw.c
@@ -166,8 +166,7 @@ static bool check_selective_binary_conversion(RelOptInfo *baserel,
 											  List **columns);
 static void estimate_size(PlannerInfo *root, RelOptInfo *baserel,
 						  FileFdwPlanState *fdw_private);
-static void estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
-						   FileFdwPlanState *fdw_private,
+static void estimate_costs(RelOptInfo *baserel, FileFdwPlanState *fdw_private,
 						   Cost *startup_cost, Cost *total_cost);
 static int	file_acquire_sample_rows(Relation onerel, int elevel,
 									 HeapTuple *rows, int targrows,
@@ -569,8 +568,7 @@ fileGetForeignPaths(PlannerInfo *root,
 										  (Node *) columns, -1));
 
 	/* Estimate costs */
-	estimate_costs(root, baserel, fdw_private,
-				   &startup_cost, &total_cost);
+	estimate_costs(baserel, fdw_private, &startup_cost, &total_cost);
 
 	/*
 	 * Create a ForeignPath node and add it as only possible path.  We use the
@@ -1139,7 +1137,7 @@ estimate_size(PlannerInfo *root, RelOptInfo *baserel,
  * Results are returned in *startup_cost and *total_cost.
  */
 static void
-estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
+estimate_costs(RelOptInfo *baserel,
 			   FileFdwPlanState *fdw_private,
 			   Cost *startup_cost, Cost *total_cost)
 {
-- 
2.34.1

>From 1e99ab2ee9a8f54140c148a5ddb37bcf9f4be321 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <[email protected]>
Date: Thu, 27 Nov 2025 07:35:29 +0000
Subject: [PATCH v2 4/6] Removing unused function parameters in postgres_fdw

A few parameters are not used, let's remove them.

Unused rte parameter in create_foreign_modify() is oversight in commit
a61b1f74823.
---
 contrib/postgres_fdw/postgres_fdw.c | 59 +++++++++--------------------
 1 file changed, 17 insertions(+), 42 deletions(-)
 100.0% contrib/postgres_fdw/

diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 06b52c65300..be66195495c 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -444,7 +444,6 @@ static void adjust_foreign_grouping_path_cost(PlannerInfo *root,
 											  double retrieved_rows,
 											  double width,
 											  double limit_tuples,
-											  int *p_disabled_nodes,
 											  Cost *p_startup_cost,
 											  Cost *p_run_cost);
 static bool ec_member_matches_foreign(PlannerInfo *root, RelOptInfo *rel,
@@ -455,7 +454,6 @@ static void fetch_more_data(ForeignScanState *node);
 static void close_cursor(PGconn *conn, unsigned int cursor_number,
 						 PgFdwConnState *conn_state);
 static PgFdwModifyState *create_foreign_modify(EState *estate,
-											   RangeTblEntry *rte,
 											   ResultRelInfo *resultRelInfo,
 											   CmdType operation,
 											   Plan *subplan,
@@ -464,8 +462,7 @@ static PgFdwModifyState *create_foreign_modify(EState *estate,
 											   int values_end,
 											   bool has_returning,
 											   List *retrieved_attrs);
-static TupleTableSlot **execute_foreign_modify(EState *estate,
-											   ResultRelInfo *resultRelInfo,
+static TupleTableSlot **execute_foreign_modify(ResultRelInfo *resultRelInfo,
 											   CmdType operation,
 											   TupleTableSlot **slots,
 											   TupleTableSlot **planSlots,
@@ -1924,7 +1921,6 @@ postgresBeginForeignModify(ModifyTableState *mtstate,
 	bool		has_returning;
 	int			values_end_len;
 	List	   *retrieved_attrs;
-	RangeTblEntry *rte;
 
 	/*
 	 * Do nothing in EXPLAIN (no ANALYZE) case.  resultRelInfo->ri_FdwState
@@ -1945,21 +1941,12 @@ postgresBeginForeignModify(ModifyTableState *mtstate,
 	retrieved_attrs = (List *) list_nth(fdw_private,
 										FdwModifyPrivateRetrievedAttrs);
 
-	/* Find RTE. */
-	rte = exec_rt_fetch(resultRelInfo->ri_RangeTableIndex,
-						mtstate->ps.state);
-
 	/* Construct an execution state. */
-	fmstate = create_foreign_modify(mtstate->ps.state,
-									rte,
-									resultRelInfo,
+	fmstate = create_foreign_modify(mtstate->ps.state, resultRelInfo,
 									mtstate->operation,
-									outerPlanState(mtstate)->plan,
-									query,
-									target_attrs,
-									values_end_len,
-									has_returning,
-									retrieved_attrs);
+									outerPlanState(mtstate)->plan, query,
+									target_attrs, values_end_len,
+									has_returning, retrieved_attrs);
 
 	resultRelInfo->ri_FdwState = fmstate;
 }
@@ -1984,7 +1971,7 @@ postgresExecForeignInsert(EState *estate,
 	 */
 	if (fmstate->aux_fmstate)
 		resultRelInfo->ri_FdwState = fmstate->aux_fmstate;
-	rslot = execute_foreign_modify(estate, resultRelInfo, CMD_INSERT,
+	rslot = execute_foreign_modify(resultRelInfo, CMD_INSERT,
 								   &slot, &planSlot, &numSlots);
 	/* Revert that change */
 	if (fmstate->aux_fmstate)
@@ -2013,7 +2000,7 @@ postgresExecForeignBatchInsert(EState *estate,
 	 */
 	if (fmstate->aux_fmstate)
 		resultRelInfo->ri_FdwState = fmstate->aux_fmstate;
-	rslot = execute_foreign_modify(estate, resultRelInfo, CMD_INSERT,
+	rslot = execute_foreign_modify(resultRelInfo, CMD_INSERT,
 								   slots, planSlots, numSlots);
 	/* Revert that change */
 	if (fmstate->aux_fmstate)
@@ -2106,7 +2093,7 @@ postgresExecForeignUpdate(EState *estate,
 	TupleTableSlot **rslot;
 	int			numSlots = 1;
 
-	rslot = execute_foreign_modify(estate, resultRelInfo, CMD_UPDATE,
+	rslot = execute_foreign_modify(resultRelInfo, CMD_UPDATE,
 								   &slot, &planSlot, &numSlots);
 
 	return rslot ? rslot[0] : NULL;
@@ -2125,7 +2112,7 @@ postgresExecForeignDelete(EState *estate,
 	TupleTableSlot **rslot;
 	int			numSlots = 1;
 
-	rslot = execute_foreign_modify(estate, resultRelInfo, CMD_DELETE,
+	rslot = execute_foreign_modify(resultRelInfo, CMD_DELETE,
 								   &slot, &planSlot, &numSlots);
 
 	return rslot ? rslot[0] : NULL;
@@ -2254,14 +2241,9 @@ postgresBeginForeignInsert(ModifyTableState *mtstate,
 					 &retrieved_attrs, &values_end_len);
 
 	/* Construct an execution state. */
-	fmstate = create_foreign_modify(mtstate->ps.state,
-									rte,
-									resultRelInfo,
-									CMD_INSERT,
-									NULL,
-									sql.data,
-									targetAttrs,
-									values_end_len,
+	fmstate = create_foreign_modify(mtstate->ps.state, resultRelInfo,
+									CMD_INSERT, NULL, sql.data,
+									targetAttrs, values_end_len,
 									retrieved_attrs != NIL,
 									retrieved_attrs);
 
@@ -2385,10 +2367,7 @@ postgresRecheckForeignScan(ForeignScanState *node, TupleTableSlot *slot)
  * error condition, we just abandon trying to do the update directly.
  */
 static ForeignScan *
-find_modifytable_subplan(PlannerInfo *root,
-						 ModifyTable *plan,
-						 Index rtindex,
-						 int subplan_index)
+find_modifytable_subplan(ModifyTable *plan, Index rtindex, int subplan_index)
 {
 	Plan	   *subplan = outerPlan(plan);
 
@@ -2477,7 +2456,7 @@ postgresPlanDirectModify(PlannerInfo *root,
 	/*
 	 * Try to locate the ForeignScan subplan that's scanning resultRelation.
 	 */
-	fscan = find_modifytable_subplan(root, plan, resultRelation, subplan_index);
+	fscan = find_modifytable_subplan(plan, resultRelation, subplan_index);
 	if (!fscan)
 		return false;
 
@@ -3495,7 +3474,6 @@ estimate_path_cost_size(PlannerInfo *root,
 				adjust_foreign_grouping_path_cost(root, pathkeys,
 												  retrieved_rows, width,
 												  fpextra->limit_tuples,
-												  &disabled_nodes,
 												  &startup_cost, &run_cost);
 			}
 			else
@@ -3642,7 +3620,6 @@ adjust_foreign_grouping_path_cost(PlannerInfo *root,
 								  double retrieved_rows,
 								  double width,
 								  double limit_tuples,
-								  int *p_disabled_nodes,
 								  Cost *p_startup_cost,
 								  Cost *p_run_cost)
 {
@@ -3955,7 +3932,6 @@ close_cursor(PGconn *conn, unsigned int cursor_number,
  */
 static PgFdwModifyState *
 create_foreign_modify(EState *estate,
-					  RangeTblEntry *rte,
 					  ResultRelInfo *resultRelInfo,
 					  CmdType operation,
 					  Plan *subplan,
@@ -4074,8 +4050,7 @@ create_foreign_modify(EState *estate,
  *		postgresExecForeignDelete.)
  */
 static TupleTableSlot **
-execute_foreign_modify(EState *estate,
-					   ResultRelInfo *resultRelInfo,
+execute_foreign_modify(ResultRelInfo *resultRelInfo,
 					   CmdType operation,
 					   TupleTableSlot **slots,
 					   TupleTableSlot **planSlots,
@@ -5657,7 +5632,7 @@ postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
  * outer rel.
  */
 static bool
-semijoin_target_ok(PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel)
+semijoin_target_ok(RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel)
 {
 	List	   *vars;
 	ListCell   *lc;
@@ -5719,7 +5694,7 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
 	/*
 	 * We can't push down semi-join if its reltarget is not safe
 	 */
-	if ((jointype == JOIN_SEMI) && !semijoin_target_ok(root, joinrel, outerrel, innerrel))
+	if ((jointype == JOIN_SEMI) && !semijoin_target_ok(joinrel, outerrel, innerrel))
 		return false;
 
 	/*
-- 
2.34.1

>From a17a72add302936fec2e03d5bceb50aa08351841 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <[email protected]>
Date: Thu, 27 Nov 2025 14:05:25 +0000
Subject: [PATCH v2 5/6] Removing unused function parameters in citext

A few parameters are not used, let's remove them.
---
 contrib/citext/citext.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
 100.0% contrib/citext/

diff --git a/contrib/citext/citext.c b/contrib/citext/citext.c
index a15ce5db829..23a242dca82 100644
--- a/contrib/citext/citext.c
+++ b/contrib/citext/citext.c
@@ -22,7 +22,7 @@ PG_MODULE_MAGIC_EXT(
  */
 
 static int32 citextcmp(text *left, text *right, Oid collid);
-static int32 internal_citext_pattern_cmp(text *left, text *right, Oid collid);
+static int32 internal_citext_pattern_cmp(text *left, text *right);
 
 /*
  *		=================
@@ -69,7 +69,7 @@ citextcmp(text *left, text *right, Oid collid)
  * Returns int32 negative, zero, or positive.
  */
 static int32
-internal_citext_pattern_cmp(text *left, text *right, Oid collid)
+internal_citext_pattern_cmp(text *left, text *right)
 {
 	char	   *lcstr,
 			   *rcstr;
@@ -130,7 +130,7 @@ citext_pattern_cmp(PG_FUNCTION_ARGS)
 	text	   *right = PG_GETARG_TEXT_PP(1);
 	int32		result;
 
-	result = internal_citext_pattern_cmp(left, right, PG_GET_COLLATION());
+	result = internal_citext_pattern_cmp(left, right);
 
 	PG_FREE_IF_COPY(left, 0);
 	PG_FREE_IF_COPY(right, 1);
@@ -320,7 +320,7 @@ citext_pattern_lt(PG_FUNCTION_ARGS)
 	text	   *right = PG_GETARG_TEXT_PP(1);
 	bool		result;
 
-	result = internal_citext_pattern_cmp(left, right, PG_GET_COLLATION()) < 0;
+	result = internal_citext_pattern_cmp(left, right) < 0;
 
 	PG_FREE_IF_COPY(left, 0);
 	PG_FREE_IF_COPY(right, 1);
@@ -337,7 +337,7 @@ citext_pattern_le(PG_FUNCTION_ARGS)
 	text	   *right = PG_GETARG_TEXT_PP(1);
 	bool		result;
 
-	result = internal_citext_pattern_cmp(left, right, PG_GET_COLLATION()) <= 0;
+	result = internal_citext_pattern_cmp(left, right) <= 0;
 
 	PG_FREE_IF_COPY(left, 0);
 	PG_FREE_IF_COPY(right, 1);
@@ -354,7 +354,7 @@ citext_pattern_gt(PG_FUNCTION_ARGS)
 	text	   *right = PG_GETARG_TEXT_PP(1);
 	bool		result;
 
-	result = internal_citext_pattern_cmp(left, right, PG_GET_COLLATION()) > 0;
+	result = internal_citext_pattern_cmp(left, right) > 0;
 
 	PG_FREE_IF_COPY(left, 0);
 	PG_FREE_IF_COPY(right, 1);
@@ -371,7 +371,7 @@ citext_pattern_ge(PG_FUNCTION_ARGS)
 	text	   *right = PG_GETARG_TEXT_PP(1);
 	bool		result;
 
-	result = internal_citext_pattern_cmp(left, right, PG_GET_COLLATION()) >= 0;
+	result = internal_citext_pattern_cmp(left, right) >= 0;
 
 	PG_FREE_IF_COPY(left, 0);
 	PG_FREE_IF_COPY(right, 1);
-- 
2.34.1

>From 9bac79f2ecd9a065686f45ae3d2386931758d99c Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <[email protected]>
Date: Thu, 27 Nov 2025 11:48:13 +0000
Subject: [PATCH v2 6/6] Removing unused function parameters in pg_walinspect

A few parameters are not used, let's remove them.
---
 contrib/pg_walinspect/pg_walinspect.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
 100.0% contrib/pg_walinspect/

diff --git a/contrib/pg_walinspect/pg_walinspect.c b/contrib/pg_walinspect/pg_walinspect.c
index 3c5e4a856a7..f8cbe51d267 100644
--- a/contrib/pg_walinspect/pg_walinspect.c
+++ b/contrib/pg_walinspect/pg_walinspect.c
@@ -58,7 +58,7 @@ static void FillXLogStatsRow(const char *name, uint64 n, uint64 total_count,
 							 uint64 rec_len, uint64 total_rec_len,
 							 uint64 fpi_len, uint64 total_fpi_len,
 							 uint64 tot_len, uint64 total_len,
-							 Datum *values, bool *nulls, uint32 ncols);
+							 Datum *values, uint32 ncols);
 static void GetWalStats(FunctionCallInfo fcinfo,
 						XLogRecPtr start_lsn,
 						XLogRecPtr end_lsn,
@@ -610,7 +610,7 @@ FillXLogStatsRow(const char *name,
 				 uint64 rec_len, uint64 total_rec_len,
 				 uint64 fpi_len, uint64 total_fpi_len,
 				 uint64 tot_len, uint64 total_len,
-				 Datum *values, bool *nulls, uint32 ncols)
+				 Datum *values, uint32 ncols)
 {
 	double		n_pct,
 				rec_len_pct,
@@ -725,7 +725,7 @@ GetXLogSummaryStats(XLogStats *stats, ReturnSetInfo *rsinfo,
 				FillXLogStatsRow(psprintf("%s/%s", desc.rm_name, id), count,
 								 total_count, rec_len, total_rec_len, fpi_len,
 								 total_fpi_len, tot_len, total_len,
-								 values, nulls, ncols);
+								 values, ncols);
 
 				tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc,
 									 values, nulls);
@@ -746,7 +746,7 @@ GetXLogSummaryStats(XLogStats *stats, ReturnSetInfo *rsinfo,
 
 			FillXLogStatsRow(desc.rm_name, count, total_count, rec_len,
 							 total_rec_len, fpi_len, total_fpi_len, tot_len,
-							 total_len, values, nulls, ncols);
+							 total_len, values, ncols);
 
 			tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc,
 								 values, nulls);
-- 
2.34.1

Reply via email to