title: Is it possible to disable delete all query in Postgres?
body: <p>Is it possible to allow only those <code>DELETE</code> queries that have a <code>WHERE</code> clause in them? </p>
  
  <p>I've tried to use <code>RULE</code> for that, but I can't figure out what to put into it's <code>WHERE</code> clause, right now this <code>RULE</code> disables all <code>DELETE</code> queries: </p>
  
  <pre><code>create rule prevent_delete_all  as on DELETE to site 
  DO INSTEAD NOTHING
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>Problem with revoking delete access from users and creating stored procedures for calling <code>DELETE</code> is that I don't want to re-write application code that is using the DB</p>