if you need to truncate tables and want to reset the autoincrement counter use this command
TRUNCATE TABLE someTable RESTART IDENTITY;
if you want to delete connected tables (e.g. via foreign key)
TRUNCATE TABLE someTable CASCASE;
of course this commands can be used sequenced.
if you have postgresql view that needs to be refreshed immediately after the parent model has changed you need to define a function and a trigger to do so.
create or replace function refresh_model_view()
returns trigger language plpgsql
refresh materialized view model;
create trigger refresh_model_view_trigger
after insert or update or delete or truncate
on parent_model for each statement
execute procedure refresh_model_view();