-- 
-- 
-- 
-- @author Dave Bauer (dave@thedesignexperience.org)
-- @creation-date 2005-01-23
-- @arch-tag: 2abf85db-45a1-4444-856d-683a01be7937
-- @cvs-id $Id: upgrade-0.3d4-0.3d5.sql,v 1.1.2.1 2005/01/23 21:05:45 daveb Exp $
--

select define_function_args('rss_gen_subscr__del','subscr_id');
create or replace function rss_gen_subscr__del (integer)
returns integer as '
declare
  p_subscr_id     alias for $1;
begin
	delete from acs_permissions
		   where object_id = p_subscr_id;

	delete from rss_gen_subscrs
		   where subscr_id = p_subscr_id;

	raise NOTICE ''Deleting subscription...'';
	PERFORM acs_object__delete(p_subscr_id);

	return 0;

end;' language 'plpgsql';

create or replace function rss_gen_subscr__delete (integer)
returns integer as '
declare
  p_subscr_id     alias for $1;
begin
  return rss_gen_subscr__del (p_subscr_id);
end;' language 'plpgsql';
