switch comparison builder to use postgres api