title: SQL - make a column unique after some timestamp?
body: <p>Here is my use case.</p>
  <p>I am using <code>Postgres 13.3</code></p>
  <p>I have a <code>people</code> table under a <code>draft</code> schema that has multiple columns.. <code>email</code> and created_at. The email should have been unique but it was not. If I alter the table to be unique, there were duplicate emails inserted before and I don't want to lose the data by removing all the duplicates. can I make the constraint to make the email unique after now or the current timestamp?</p>
  <p>I have tried this which obviously is a syntax error</p>
  <pre><code>ALTER TABLE draft.people ADD UNIQUE (email) WHERE created_at &gt; timestamp()
  </code></pre>
  <p>I also tried to add a check constraint but it throws a syntax error..should I write a function that is triggered before insert?</p>