Re: ON CONFLICT with constraint name doesn't work

From: Andres Freund <andres(at)anarazel(dot)de>
To: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: ON CONFLICT with constraint name doesn't work
Date: 2017-03-16 19:40:50
Message-ID: 20170316194050.ysgx2gnavxwivigk@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hi,

On 2017-03-16 12:34:49 -0700, Nikolay Samokhvalov wrote:
> I'm trying to explicitly use the constraint name of my UNIQUE INDEX but it
> doesn't work (Postgres 9.6.2):
>
> [local]:5432 nikolay(at)test=# create table constr(id serial, msg text);
> CREATE TABLE
>
> [local]:5432 nikolay(at)test=# create unique index i_constr_msg on constr
> using btree(md5(msg));
> CREATE INDEX

A unique index isn't exactly the same as a unique constraint - you
really need to create a constraint.

- Andres

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2017-03-16 19:42:04 Re: ON CONFLICT with constraint name doesn't work
Previous Message Nikolay Samokhvalov 2017-03-16 19:34:49 ON CONFLICT with constraint name doesn't work

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2017-03-16 19:42:04 Re: ON CONFLICT with constraint name doesn't work
Previous Message Nikolay Samokhvalov 2017-03-16 19:34:49 ON CONFLICT with constraint name doesn't work