I got table with two unique column:
CREATE TABLE "users" (
"id" bigserial PRIMARY KEY,
"phone" varchar(20) UNIQUE,
"email" varchar(50) UNIQUE
);
I want to write save or update method
My jooq code:
dsl.insertInto(Users.USERS)
.set(Users.USERS.EMAIL, user.getEmail())
.set(Users.USERS.PHONE, user.getPhone())
.onConflict(Users.USERS.PHONE, Users.USERS.EMAIL)
.doNothing()
.execute();
But i got exception:
"ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification"
Help please.