-- -- util__logical_negation/1 -- create or replace function util__logical_negation( boolean ) returns bool as $$ declare true_or_false alias for $1; begin IF true_or_false is null THEN return null; ELSE IF true_or_false = 'f' THEN return 't'; ELSE return 'f'; END IF; END IF; END;$$ language plpgsql;