Re: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification
Date: 2018-05-05 16:08:51
Message-ID: CAADeyWgfwDnFQ+wJo4eEPMnOOJgrrtQU6mNS4Xh40JqKy=0XRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Even the simpler INSERT statement

INSERT INTO stats(uid, single_q_left)
SELECT player1, COUNT(*)
FROM games
WHERE hand1 = '{Q}'
GROUP BY player1
ON CONFLICT(uid) DO NOTHING;

produces the same error.

On Sat, May 5, 2018 at 4:49 PM, Alexander Farber <alexander(dot)farber(at)gmail(dot)com
> wrote:

> http://sqlfiddle.com/#!17/7e929/13
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-05-05 16:57:28 Re: comparison between 2 execution plans
Previous Message Ian Harding 2018-05-05 15:31:04 Re: statement_timeout issue