title: How to add a Time dependent trigger in PostgreSQL?
body: <p>I'm confused and clueless on how to:</p>
  
  <ul>
  <li>Add a trigger to a postgresql db once the db has been set up, i.e. adding a trigger by clicking a hyperlink</li>
  <li>Write a trigger function so that it deletes a specific row after a week has passed since the trigger was written.</li>
  </ul>
  
  <p>This is the sequence once events just for clarity</p>
  
  <ol>
  <li>Admin sees entry in db via a php generated html page. </li>
  <li>Admin clicks 'approve' hyperlink next to db entry. </li>
  <li>This creates a trigger in the db to delete that specific row after 1 week has passed.</li>
  </ol>
  
  <p>I need help with step 3</p>
  
  <p>Would an alternative way of doing this be to have a trigger on the table, so that when a row is inserted a new trigger is created which checks the value of an 'approved' column for that row. When the Admin clicks 'approve' in the html page the word 'yes' is inserted to the 'approved' column for that row. The trigger will detect this and add a new trigger to delete the row after a week?</p>
  
  <p>As you can tell i'm really not sure which way to do it and how to do it so any feedback would be much appreciated. Thanks.</p>