Applied PG and changed SQL to dev