Re: INSERT ... ON CONFLICT error messages - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: INSERT ... ON CONFLICT error messages
Date
Msg-id CAM3SWZRu642Q0WbVO+aaeKEwrF2+473nwRBL_tAwm_J9ZjBQ6g@mail.gmail.com
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT error messages  (Andres Freund <andres@anarazel.de>)
Responses Re: INSERT ... ON CONFLICT error messages  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On Thu, May 7, 2015 at 11:32 AM, Andres Freund <andres@anarazel.de> wrote:
> Hm. I don't really see a point in allowing it - it seems more likely to
> be a mistake by the user, expecting that the insertion now works
> conflict free.  But I don't really care much.

The only downside I see is that it might not work in preventing the
statement from proceeding. In other words, you might have a partial
unique index style inference clause (i.e. with a predicate) that
infers a non-partial index, because everything else matches, and no
predicate (on the index) satisfies the inference predicate. So it
comes down to the actual definition of indexes, as opposed to the
statement that inferred those indexes, which isn't quite the same
thing.

It is hardly really a defect at all, but it is something I have
considered as a little confusing. However, I doubt that many people
will ever find themselves looking for an explanation for this.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Disabling trust/ident authentication configure option
Next
From: Peter Geoghegan
Date:
Subject: Re: INSERT ... ON CONFLICT error messages