Re: [PATCH] Fix duplicate errmsg in ALTER TABLE SPLIT PARTITION

Yuchen Li <liyuchen_xyz@163.com>

From: Yuchen Li <liyuchen_xyz@163.com>
To: Ayush Tiwari <ayushtiwari.slg01@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Daniel Gustafsson <daniel@yesql.se>
Date: 2026-04-21T05:40:41Z
Lists: pgsql-hackers
On 4/21/2026 12:34 PM, Ayush Tiwari wrote:
> Hi hackers,
>
> The ereport() in transformPartitionCmdForSplit() that fires when
> splitting a non-default partition while a default partition already
> exists has two errmsg() calls:
>
>     ereport(ERROR,
>             errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
>             errmsg("can not split non-DEFAULT partition \"%s\"", ...),
>             errmsg("new partition cannot be DEFAULT because ..."),
>             parser_errposition(...));
>
> The second one should had been errdetail()
>
> The attached patch changes the second errmsg() to errdetail().
>
> Also, I think "can not" can be replaced with "cannot" for consistency
> throughout? Havent added is as part of this patch though. Thoughts?
>
> Regards,
> Ayush

Good catch. I agree the second one should be a detail. The first letter 
has been capitalized, and a period is added. So, the patch looks good to me.

Regards,
Yuchen Li




Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Rationalize error comments in partition split/merge tests

  2. Message corrections for partition split/merge commands