Replacement Bugtracker PostGreSQL Function

For some reason somewhere in the 3.x¹ series one of the PostGreSQL functions got replaced with a function that provides absolutely no functionality at all in ]po[. It took me about 2 days to finally track this one down so I am posting it here because I need it every once in a while when at a client. ;)

create or replace function ad_group_member_p (integer, integer) returns char as 
'DECLARE
  p_user_id alias for $1;
  p_group_id alias for $2;
  ad_group_member_count integer;
BEGIN
  select count(*) into ad_group_member_count from acs_rels where object_id_one = p_group_id and object_id_two = p_user_id;

if ad_group_member_count = 0 then
  return ''f'';
else
  return ''t'';
end if;
end;'
language 'plpgsql';
  1. This fix is only viable until the BT gets switched out for the new one in the 4.x series of ]po[
/var/customers/webs/cw01/wiki/data/pages/project-open/bugtracker_pgsql_function.txt · Last modified: 2010/05/24 18:37 by wadmin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki