Re: misleading error message in DefineIndex - Mailing list pgsql-hackers

From jian he
Subject Re: misleading error message in DefineIndex
Date
Msg-id CACJufxFO1+_iPDDqTTrc58gOME=Xt08X8OVThLkkL2hswWRtyA@mail.gmail.com
Whole thread Raw
In response to Re: misleading error message in DefineIndex  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
On Mon, Nov 17, 2025 at 8:52 PM Daniel Gustafsson <daniel@yesql.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

pgsql-hackers by date:

Previous
From: Alexander Pyhalov
Date:
Subject: Re: Asynchronous MergeAppend
Next
From: Yugo Nagata
Date:
Subject: Add a berief general comment on BTScanInsertData's nextkey and backward