Issue #1053190 by fivefrank : postgresql compat, simplify the crawler pruning sql query so that it works everywhere.