On Tue, Feb 7, 2017 at 12:44 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Hm. I looked at infer_arbiter_indexes, which is the place where this
> particular error is thrown, and realized that my previous assertion
> was wrong: it *does* try to prove applicability of partial indexes
> based on the ON CONFLICT WHERE clause.
I must have misunderstood. ON CONFLICT accepts a WHERE clause as part
of the inference specification itself entirely because that is
sometimes useful.
> So actually it should be
> deciding that uniq_person_accounts is a usable unique index --- at
> least, if you always have "WHERE type = 'PersonAccount'" in the
> ON CONFLICT clause. Maybe you're sometimes leaving that out?
That's the simplest answer. Tiago?
--
Peter Geoghegan
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs