Re: misleading error message in DefineIndex

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: misleading error message in DefineIndex
Date: 2025-11-18 07:22:09
Message-ID: CACJufxFO1+_iPDDqTTrc58gOME=Xt08X8OVThLkkL2hswWRtyA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 17, 2025 at 8:52 PM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>
> Some of the internals does seem bleed through. Do you want to work on a patch
> for a suggestion on an improvement? Maybe it could be possible to improve the
> wording by incorporating constraint_type in some way?
>

I have changed this ereport:

ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("unique constraint on partitioned table must include
all partitioning columns"),
errdetail("%s constraint on table \"%s\" lacks column \"%s\"
which is part of the partition key.",
constraint_type, RelationGetRelationName(rel),
NameStr(att->attname))));

to
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("%s constraint on partitioned table
must include all partitioning columns", constraint_type),
+ errdetail("%s constraint on partitioned table
\"%s\" lacks column \"%s\" which is part of the partition key.",
+ constraint_type,
RelationGetRelationName(rel),
+ NameStr(att->attname)));

Attachment Content-Type Size
v1-0001-Minor-enhancement-to-the-error-message-in-DefineIndex.patch text/x-patch 11.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2025-11-18 07:28:01 Add a berief general comment on BTScanInsertData's nextkey and backward
Previous Message Alexander Pyhalov 2025-11-18 07:14:23 Re: Asynchronous MergeAppend