I have a table event_logs with two columns of interest for which I would like to create an index. The problem is one of the columns is a datetime field, which is fine for 99% of the things we use it for as it stores both the date and time for a given event.
However I would like to create a unique index which would make it impossible to create two events on the same date (not datetime, but just the date) with the same person.
- quiz_master_id (integer)
- start_at (datetime)
Is it even possible to do such a think to create such a unique index for a given date instead of datetime? Or is there another similar method to deal with this in Postgres?