I've got the following table:
userId|imageId|
------|-------|
1| 1|
1| 2|
1| 3|
and in a special validator I want to make sure that those imageIds I'm given (let's say, 2 and 3) exist in this table and belong to a user with userId = 1;
How do I do that in Postgres?
My PostgreSQL is 12.3.