Partial Index not used in ON CONFLICT clause while performing an upsert in Postgresql
问题 I have the following Entity Attribute value table : CREATE TABLE key_value_pair ( id serial NOT NULL PRIMARY KEY, key varchar(255) NOT NULL, value varchar(255), is_active boolean ); CREATE UNIQUE INDEX key_value_pair_key_if_is_active_true_unique ON key_value_pair (key) WHERE is_active = true; Sample entries in this table are : id | key | value | is_active ----+-------------+-------+----------- 1 | temperature | 2 | f 2 | temperature | 12 | f 3 | temperature | 15 | f 4 | temperature | 19 | f 5