Re: [BUGS] ON CONFLICT with constraint name doesn't work - Mailing list pgsql-bugs

From Andres Freund
Subject Re: [BUGS] ON CONFLICT with constraint name doesn't work
Date
Msg-id 20170316202359.zi44m4smfq6nvd6s@alap3.anarazel.de
Whole thread Raw
In response to Re: [BUGS] ON CONFLICT with constraint name doesn't work  (Nikolay Samokhvalov <samokhvalov@gmail.com>)
Responses Re: [BUGS] ON CONFLICT with constraint name doesn't work  (Nikolay Samokhvalov <samokhvalov@gmail.com>)
List pgsql-bugs
On 2017-03-16 13:08:53 -0700, Nikolay Samokhvalov wrote:
> On Thu, Mar 16, 2017 at 12:40 PM, Andres Freund <andres@anarazel.de> wrote:
> >
> > A unique index isn't exactly the same as a unique constraint - you
> > really need to create a constraint.
> 
> 
> Then we probably need to fix this message?
> 
> [local]:5432 nikolay@test=# insert into constr (msg) values ('hohoho') ;
> INSERT 0 1
> 
> [local]:5432 nikolay@test=# insert into constr (msg) values ('hohoho') ;
> ERROR:  duplicate key value violates unique constraint "i_constr_msg"
> DETAIL:  Key (md5(msg))=(8b0dc2e34844337434b8475108a490ab) already exists.
> 
> -- it tells us explicitly, that we have a *constraint* named "i_constr_msg".

Seems like a good idea to improve that message.  I wouldn't vote for
backpatching it, however.  Could you propose a patch for that?

Greetings,

Andres Freund


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Nikolay Samokhvalov
Date:
Subject: Re: [BUGS] ON CONFLICT with constraint name doesn't work
Next
From: Andres Freund
Date:
Subject: Re: [BUGS] BUG #14057: vacuum setting reltuples=0 for tables with >0tuples