title: ALTER TABLE to add ON DELETE CASCADE statement
body: <p>I want to do the following in PostgreSQL (using Hibernate):</p>
  
  <pre><code> ALTER TABLE fruits ADD CONSTRAINTS id ON DELETE CASCADE;
  </code></pre>
  
  <p>Obviously, my code above is not working, so I am looking for the correct statement.</p>
  
  <p>If I can't do that, then how about the following:</p>
  
  <p>I have a bunch of data in my table <code>fruits</code>. The <code>id</code> field in <code>fruits</code> is used as a foreign key by table <code>grapes</code>. I need to delete a specific row in <code>fruits</code> and I want the deletion to cascade to <code>grapes</code> and delete all entries in <code>grapes</code> that has the specified <code>id</code>. How do I do that?</p>
  
  <pre><code>delete from fruits where id = 1 cascade; 
  </code></pre>
  
  <p>NOTE: I don't want to do a join and delete the corresponding data in <code>grape</code>. This is just an example. In the real application a large number of tables depend on <code>fruits</code>.</p>
  
  <p>Since I am using Hibernate, for the case when I use a delete statement, can hibernate help do it?<br>
  Or can I do this with the information schema or system catalog in PostgreSQL?</p>