fixed redmine postgresql functions