First, it depends on how your foreign keys are declared. Assuming tables like:
CREATE TABLE parent
( pid ... not null primary key
CREATE TABLE child
, pid ... not null
references parent (pid)
on delete <action>
on update ...
action can be any of:
Produce an error indicating that the deletion or update would create a foreign
key constraint violation. If the constraint is deferred, this error will be
produced at constraint check time if there still exist any referencing rows.
This is the default action.
Produce an error indicating that the deletion or update would create a foreign key constraint violation. This is the same as NO ACTION except that the check is not deferrable.
Delete any rows referencing the deleted row, or update the value of the referencing column to the new value of the referenced column, respectively.
Set the referencing column(s) to null.
Set the referencing column(s) to their default values.
If your foreign keys are declared as "on delete cascade" it is - in theory - sufficient to delete the root node. In practice, there may be physical limitations that restrict the total number of rows that can be deleted in one transaction.
If you want to experiment with the different actions you can use Fiddle. 9.5 is the oldest one available. If you are still on 9.2, consider upgrading to something more modern.