Re: BUG #14526: no unique or exclusion constraint matching the ON CONFLICT

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: tiago(dot)babo(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14526: no unique or exclusion constraint matching the ON CONFLICT
Date: 2017-02-07 09:03:32
Message-ID: CAH2-Wz=h4uZuFwAPmU3eNZ-mh=PorhSw75Nt0HYgsWV9GtUMOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Feb 2, 2017 at 6:07 AM, <tiago(dot)babo(at)gmail(dot)com> wrote:
> INSERT INTO accounts (type, person_id) VALUES ('PersonAccount', 1) ON
> CONFLICT (type, person_id) WHERE type = 'PersonAccount' DO UPDATE SET
> updated_at = EXCLUDED.updated_at RETURNING *
>
> I also have an unique INDEX:
>
> CREATE UNIQUE INDEX uniq_person_accounts ON accounts USING btree (type,
> person_id) WHERE ((type)::text = 'PersonAccount'::text);

Can you show the table definition? From psql, "\d+ accounts"

--
Peter Geoghegan

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message CR VV 2017-02-07 12:56:00 Re: BUG #14524: Commands compare with nested subquery expressions fail with "should not reference subplan var"
Previous Message leohuanruan 2017-02-07 05:43:47 BUG #14530: Logical Decoding Slowness