From e6d26826027447c897dcf07e0f306878dd450fb0 Mon Sep 17 00:00:00 2001
From: Man Zeng <zengman@halodbtech.com>
Date: Wed, 11 Feb 2026 15:02:03 +0800
Subject: [PATCH] Replace "can't" with "cannot" in error messages for
 consistency

---
 contrib/amcheck/verify_nbtree.c           | 4 ++--
 contrib/cube/cube.c                       | 6 +++---
 src/backend/access/transam/xlog.c         | 2 +-
 src/backend/commands/tablecmds.c          | 2 +-
 src/backend/optimizer/prep/prepqual.c     | 2 +-
 src/backend/storage/aio/method_io_uring.c | 2 +-
 src/backend/storage/ipc/dsm.c             | 2 +-
 src/backend/storage/page/bufpage.c        | 2 +-
 src/bin/pg_basebackup/walmethods.c        | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/contrib/amcheck/verify_nbtree.c b/contrib/amcheck/verify_nbtree.c
index 34433e819d4..cbde10aa84d 100644
--- a/contrib/amcheck/verify_nbtree.c
+++ b/contrib/amcheck/verify_nbtree.c
@@ -2204,7 +2204,7 @@ bt_child_highkey_check(BtreeCheckState *state,
 		if (blkno == P_NONE)
 			ereport(ERROR,
 					(errcode(ERRCODE_INDEX_CORRUPTED),
-					 errmsg("can't traverse from downlink %u to downlink %u of index \"%s\"",
+					 errmsg("cannot traverse from downlink %u to downlink %u of index \"%s\"",
 							state->prevrightlink, downlink,
 							RelationGetRelationName(state->rel))));
 
@@ -2337,7 +2337,7 @@ bt_child_highkey_check(BtreeCheckState *state,
 				if (!state->lowkey)
 					ereport(ERROR,
 							(errcode(ERRCODE_INDEX_CORRUPTED),
-							 errmsg("can't find left sibling high key in index \"%s\"",
+							 errmsg("cannot find left sibling high key in index \"%s\"",
 									RelationGetRelationName(state->rel)),
 							 errdetail_internal("Target block=%u child block=%u target page lsn=%X/%08X.",
 												state->targetblock, blkno,
diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c
index 77263ab277f..99886999e98 100644
--- a/contrib/cube/cube.c
+++ b/contrib/cube/cube.c
@@ -161,7 +161,7 @@ cube_a_f8_f8(PG_FUNCTION_ARGS)
 	if (dim > CUBE_MAX_DIM)
 		ereport(ERROR,
 				(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
-				 errmsg("can't extend cube"),
+				 errmsg("cannot extend cube"),
 				 errdetail("A cube cannot have more than %d dimensions.",
 						   CUBE_MAX_DIM)));
 
@@ -1831,7 +1831,7 @@ cube_c_f8(PG_FUNCTION_ARGS)
 	if (DIM(cube) + 1 > CUBE_MAX_DIM)
 		ereport(ERROR,
 				(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
-				 errmsg("can't extend cube"),
+				 errmsg("cannot extend cube"),
 				 errdetail("A cube cannot have more than %d dimensions.",
 						   CUBE_MAX_DIM)));
 
@@ -1879,7 +1879,7 @@ cube_c_f8_f8(PG_FUNCTION_ARGS)
 	if (DIM(cube) + 1 > CUBE_MAX_DIM)
 		ereport(ERROR,
 				(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
-				 errmsg("can't extend cube"),
+				 errmsg("cannot extend cube"),
 				 errdetail("A cube cannot have more than %d dimensions.",
 						   CUBE_MAX_DIM)));
 
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 13ec6225b85..4f173274542 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7037,7 +7037,7 @@ CreateCheckPoint(int flags)
 
 	/* sanity check */
 	if (RecoveryInProgress() && (flags & CHECKPOINT_END_OF_RECOVERY) == 0)
-		elog(ERROR, "can't create a checkpoint during recovery");
+		elog(ERROR, "cannot create a checkpoint during recovery");
 
 	/*
 	 * Prepare to accumulate statistics.
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index f976c0e5c7e..c1b168fa92f 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -21086,7 +21086,7 @@ ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
 		if (rel == NULL)
 		{
 			if (partRel != NULL)	/* shouldn't happen */
-				elog(WARNING, "dangling partition \"%s\" remains, can't fix",
+				elog(WARNING, "dangling partition \"%s\" remains, cannot fix",
 					 partrelname);
 			ereport(ERROR,
 					(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
diff --git a/src/backend/optimizer/prep/prepqual.c b/src/backend/optimizer/prep/prepqual.c
index c71729bb1b0..0c5b0112624 100644
--- a/src/backend/optimizer/prep/prepqual.c
+++ b/src/backend/optimizer/prep/prepqual.c
@@ -73,7 +73,7 @@ Node *
 negate_clause(Node *node)
 {
 	if (node == NULL)			/* should not happen */
-		elog(ERROR, "can't negate an empty subexpression");
+		elog(ERROR, "cannot negate an empty subexpression");
 	switch (nodeTag(node))
 	{
 		case T_Const:
diff --git a/src/backend/storage/aio/method_io_uring.c b/src/backend/storage/aio/method_io_uring.c
index ed6e71bcd46..3a2bccfa7e3 100644
--- a/src/backend/storage/aio/method_io_uring.c
+++ b/src/backend/storage/aio/method_io_uring.c
@@ -218,7 +218,7 @@ pgaio_uring_check_capabilities(void)
 #else
 	{
 		elog(DEBUG1,
-			 "can't use combined memory mapping for io_uring, kernel or liburing too old");
+			 "cannot use combined memory mapping for io_uring, kernel or liburing too old");
 	}
 #endif
 
diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c
index 6a5b16392f7..2cdbcda1c8d 100644
--- a/src/backend/storage/ipc/dsm.c
+++ b/src/backend/storage/ipc/dsm.c
@@ -689,7 +689,7 @@ dsm_attach(dsm_handle h)
 	{
 		seg = dlist_container(dsm_segment, node, iter.cur);
 		if (seg->handle == h)
-			elog(ERROR, "can't attach the same segment more than once");
+			elog(ERROR, "cannot attach the same segment more than once");
 	}
 
 	/* Create a new segment descriptor. */
diff --git a/src/backend/storage/page/bufpage.c b/src/backend/storage/page/bufpage.c
index de85911e3ac..d1ce699934f 100644
--- a/src/backend/storage/page/bufpage.c
+++ b/src/backend/storage/page/bufpage.c
@@ -296,7 +296,7 @@ PageAddItemExtended(Page page,
 	/* Reject placing items beyond heap boundary, if heap */
 	if ((flags & PAI_IS_HEAP) != 0 && offsetNumber > MaxHeapTuplesPerPage)
 	{
-		elog(WARNING, "can't put more than MaxHeapTuplesPerPage items in a heap page");
+		elog(WARNING, "cannot put more than MaxHeapTuplesPerPage items in a heap page");
 		return InvalidOffsetNumber;
 	}
 
diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c
index 17d22c79f68..7bbd475fb63 100644
--- a/src/bin/pg_basebackup/walmethods.c
+++ b/src/bin/pg_basebackup/walmethods.c
@@ -889,7 +889,7 @@ tar_open_for_write(WalWriteMethod *wwmethod, const char *pathname,
 	if (tar_data->currentfile != NULL)
 	{
 		wwmethod->lasterrstring =
-			_("implementation error: tar files can't have more than one open file");
+			_("implementation error: tar files cannot have more than one open file");
 		return NULL;
 	}
 
-- 
2.45.2

