sql condition
pg
scoped status and tests