Deleting aged rows from postgresql table which don't have related entries in another table
Use a subrequest : this should work

DELETE FROM links_link WHERE id NOT IN (select answer_to from links_publicreply ) AND `submitted_on` &lt; CURRENT_DATE-1 ;


You can have of course multiple subrequest chained.