v2-0001-Adjust-errcode-in-checkPartition.patch
text/plain
Filename: v2-0001-Adjust-errcode-in-checkPartition.patch
Type: text/plain
Part: 0
From 492c595cf481c67eb2b4823ae3e389d0a6fb7f83 Mon Sep 17 00:00:00 2001
From: Tender Wang <tndrwang@gmail.com>
Date: Sat, 20 Dec 2025 10:56:36 +0800
Subject: [PATCH v2] Adjust errcode in checkPartition().
Replace ERRCODE_UNDEFINED_TABLE with ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE.
---
src/backend/parser/parse_utilcmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 2b7b084f216..de8c0a5560b 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -3544,7 +3544,7 @@ checkPartition(Relation rel, Oid partRelOid, bool isMerge)
if (get_partition_parent(partRelOid, false) != RelationGetRelid(rel))
ereport(ERROR,
- errcode(ERRCODE_UNDEFINED_TABLE),
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("relation \"%s\" is not a partition of relation \"%s\"",
RelationGetRelationName(partRel), RelationGetRelationName(rel)),
isMerge
--
2.34.1