On Wed, Sep 3, 2014 at 9:51 AM, Robert Haas <robertmh...@gmail.com> wrote: >> INSERT INTO upsert(key, val) VALUES(1, 'insert') ON CONFLICT WITHIN >> upsert_pkey UPDATE SET val = 'update'; > > It seems to me that it would be better to specify a conflicting column > set rather than a conflicting index name.
I'm open to pursuing that, provided there is a possible implementation that's robust against things like BEFORE triggers that modify constrained attributes. It must also work well with partial unique indexes. So I imagine we'd have to determine a way of looking up the unique index only after BEFORE triggers fire. Unless you're comfortable with punting on some of these cases by throwing an error, then all of this is actually surprisingly ticklish. You've already expressed concerns about the feature not playing nice with existing, peripheral features though. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers