Run postgres script only on master or db_slave
fix elastic search recipe