postgresql7.1 select acs_rel_type__drop_role(:role) select case when exists (select 1 from acs_rel_types where role_one = :role or role_two = :role) then 1 else 0 end