-- -- download_rep__delete/1 -- create or replace function download_rep__delete( integer ) returns int4 as $$ declare delete__repository_id alias for $1; begin delete from acs_objects where context_id = delete__repository_id; delete from download_repository where repository_id = delete__repository_id; PERFORM acs_object__delete( delete__repository_id ); return 0; end;$$ language plpgsql;