You can simply use the operator DELETEinstead SELECTto do your job:
with recursive all_posts (id, parentid, root_id) as (
select t1.id,
t1.parent_forum_post_id as parentid,
t1.id as root_id
from forumposts t1
union all
select c1.id,
c1.parent_forum_post_id as parentid,
p.root_id
from forumposts
c1
join all_posts p on p.id = c1.parent_forum_post_id
)
DELETE FROM forumposts
WHERE id IN (SELECT id FROM all_posts WHERE root_id=1349);
, , .
EDIT: PostgresSQL 9.1 :
DELETE FROM forumposts WHERE id IN (
with recursive all_posts (id, parentid, root_id) as (
select t1.id,
t1.parent_forum_post_id as parentid,
t1.id as root_id
from forumposts t1
union all
select c1.id,
c1.parent_forum_post_id as parentid,
p.root_id
from forumposts c1
join all_posts p on p.id = c1.parent_forum_post_id
)
select id from all_posts ap where root_id=1349
);