PostgreSQL Upsert not working on Partitioned Table
Upsert on partitioned tables is not implemented in versions earlier than Postgres 11.

In Postgres 9.6:


  INSERT statements with ON CONFLICT clauses are unlikely to work as expected, as the ON CONFLICT action is only taken in case of unique violations on the specified target relation, not its child relations.


Declarative partitioning does not resolve the problem, Postgres 10:


  Using the ON CONFLICT clause with partitioned tables will cause an error, because unique or exclusion constraints can only be created on individual partitions. There is no support for enforcing uniqueness (or an exclusion constraint) across an entire partitioning hierarchy.


Workaround


create unique indexes ("user", type, date) on all child tables,
create and use a function for insert/update based on the Example 42.2. Exceptions with UPDATE/INSERT described in the documentation.


In Postgres 11 you can use ON CONFLICT on partitioned tables, see lad2025's answer.