Add freebusy support. Remove different Pg8.1 code path which is probably

not actually any better than the 7.4 compatible implementation.
This commit is contained in:
Andrew McMillan 2006-12-11 13:19:09 +13:00
parent 3f3804cd43
commit 8a6348e736

View File

@ -253,23 +253,17 @@ BEGIN
IF out_confers = tmp_confers THEN IF out_confers = tmp_confers THEN
RETURN dbg || out_confers; RETURN dbg || out_confers;
ELSE ELSE
IF tmp_confers ~* ''A'' AND NOT tmp_confers ~* ''BRWU'' THEN IF tmp_confers ~* ''A'' AND NOT tmp_confers ~* ''FBRWU'' THEN
-- Ensure that A is expanded to all privs -- Ensure that A is expanded to all supported privs before being used as a mask
tmp_confers := tmp_confers || ''BRWU''; tmp_confers := tmp_confers || ''FBRWU'';
END IF;
IF (SELECT substring(setting,1,3)::numeric >= 8.1 FROM pg_settings WHERE name = ''server_version'') THEN
-- PostgreSQL 8.1 or later. regexp_replace exists!
out_confers := regexp_replace( out_confers, ''([^'' || tmp_confers || '']*)'', '''' );
RETURN dbg || out_confers;
ELSE
tmp_txt = '''';
FOR counter IN 1 .. length(tmp_confers) LOOP
IF out_confers ~* substring(tmp_confers,counter,1) THEN
tmp_txt := tmp_txt || substring(tmp_confers,counter,1);
END IF;
END LOOP;
RETURN dbg || tmp_txt;
END IF; END IF;
tmp_txt = '''';
FOR counter IN 1 .. length(tmp_confers) LOOP
IF out_confers ~* substring(tmp_confers,counter,1) THEN
tmp_txt := tmp_txt || substring(tmp_confers,counter,1);
END IF;
END LOOP;
RETURN dbg || tmp_txt;
END IF; END IF;
END IF; END IF;