From 1f64a37a8f91d4ab0bfbf7a9e0416f19d33970c0 Mon Sep 17 00:00:00 2001 From: Ayush Tiwari Date: Tue, 21 Apr 2026 09:53:39 +0530 Subject: [PATCH] Fix duplicate errmsg in ALTER TABLE SPLIT PARTITION The ereport() call for splitting a non-default partition when a default partition already exists had two errmsg() arguments. Since ereport() only keeps the last one, the primary message was silently discarded and only the secondary message was shown to the user. Change the second errmsg() to errdetail(). --- src/backend/parser/parse_utilcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index b694fd50f15..48ae3e3e2be 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -3664,8 +3664,8 @@ transformPartitionCmdForSplit(CreateStmtContext *cxt, PartitionCmd *partcmd) errcode(ERRCODE_INVALID_OBJECT_DEFINITION), errmsg("can not split non-DEFAULT partition \"%s\"", get_rel_name(splitPartOid)), - errmsg("new partition cannot be DEFAULT because DEFAULT partition \"%s\" already exists", - get_rel_name(defaultPartOid)), + errdetail("New partition cannot be DEFAULT because DEFAULT partition \"%s\" already exists.", + get_rel_name(defaultPartOid)), parser_errposition(cxt->pstate, spsDef->name->location)); } -- 2.34.1