I have a table that has a timestamp column something like:
table Elements
id: uuid
date: timestamp
name: varchar
type: varchar
I would like to put a unique constraint on the table that will make sure that there are NO two entries with the same name and type and are within X months of any other row. I have asynchronous processes that push rows into this table, and doing a select before can fail due to race conditions.