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