PostgreSQL Upsert with a WHERE clause
问题 I am trying to migrate an Oracle merge query to PostgreSql. As described in this article, Postgres UPSERT syntax supports a "where clause" to identify conditions of conflict. Unfortunately, that webpage does not provide an example with the "where clause". I tried searching for it elsewhere but could not find it. Hence this question. Following the same example in the above given webpage, here is an example setup: CREATE TABLE customers ( customer_id serial PRIMARY KEY, name VARCHAR UNIQUE,