Though it is a rare occurrence, we have had occasions where we need to purge ALL data from a table. Our preferred is the
TRUNCATE TABLE approach because it's orders of magnitude faster than the
DELETE FROM construct. You however can't use
TRUNCATE TABLE unqualified, if the table you are truncating has foreign key references from other tables.
In comes its extended form, the
TRUNCATE TABLE .. CASCADE construct which was introduced in PostgreSQL 8.2, which will not only delete all data from the main table, but will CASCADE to all the referenced tables.