if you are just deleting all data in some tables in postgresql ...
you can truncate the 2 tables together like :
truncate table table1, table2;
otherwise you can see the other answers