Fix test for environments with postgres 

There are some scopes that not compatible with postgres' syntax.