fix scope for postgres