Re: Partial update on an postgres upsert violates constraint - Mailing list pgsql-general

From Tom Lane
Subject Re: Partial update on an postgres upsert violates constraint
Date
Msg-id 32134.1479589039@sss.pgh.pa.us
Whole thread Raw
In response to Re: Partial update on an postgres upsert violates constraint  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Partial update on an postgres upsert violates constraint  (Andreas Terrius <gotenwinz99@gmail.com>)
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> ... So looks like constraints are checked before you get to the ON CONFLICT section.

Right.  ON CONFLICT is a means for dealing with duplicate-key errors in
the specified (or inferred) unique index.  It is *not* an all-purpose
error catcher.  In the case at hand, the given INSERT request fails due
to not-null constraints that are unrelated to what the ON CONFLICT clause
tests for.

            regards, tom lane


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Partial update on an postgres upsert violates constraint
Next
From: Jeff Janes
Date:
Subject: Strict min and max aggregate functions