Re: Error message inconsistency - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Error message inconsistency
Date
Msg-id CAA4eK1L6CBWprTYMcwu7-71kg+DD6_T7nQyxf0fyAH5kTbWUSQ@mail.gmail.com
Whole thread Raw
In response to Re: Error message inconsistency  (MBeena Emerson <mbeena.emerson@gmail.com>)
List pgsql-hackers
On Wed, Jan 22, 2020 at 3:23 PM MBeena Emerson <mbeena.emerson@gmail.com> wrote:
>
> > -----------------------------------------------------------------------------------------------------
> > 14. src/backend/commands/tablecmds.c
> >
> >  5310                 else
> >  5311                     ereport(ERROR,
> >  5312                             (errcode(ERRCODE_CHECK_VIOLATION),
> >  5313                              errmsg("partition constraint is violated by some row")));
> >
> > Added relation name for this error.  This can be verified by below example:
> > Ex:
> > CREATE TABLE list_parted (a int,b char)PARTITION BY LIST (a);
> > CREATE TABLE part_1 (LIKE list_parted);
> > INSERT INTO part_1 VALUES (3, 'a');
> > ALTER TABLE list_parted ATTACH PARTITION part_1 FOR VALUES IN (2);
> >
> > Without patch:
> > ERROR:  partition constraint is violated by some row
> > With patch:
> > ERROR:  partition constraint "part_1" is violated by some row
>
> Here it seems as if "part_1" is the constraint name.
>

I agree.

>  It would be
> better to change it to:
>
> partition constraint is violated by some row in relation "part_1" OR
> partition constraint of relation "part_1" is violated b some row
>

+1 for the second option suggested by Beena.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions
Next
From: Craig Ringer
Date:
Subject: Re: Do we need to handle orphaned prepared transactions in the server?