Fixing searches for postgres